Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. const map = (fn, list) => {
  2. if (list.length === 0) {
  3. return []
  4. }
  5. const [fst, ...rest] = list
  6. return [fn(fst)].concat(map(fn, rest))
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement