Skip to content

Instantly share code, notes, and snippets.

@IwoHerka
Created June 28, 2019 10:05
Show Gist options
  • Save IwoHerka/bf79c93daf97a4021506894d8d947e6e to your computer and use it in GitHub Desktop.
Save IwoHerka/bf79c93daf97a4021506894d8d947e6e to your computer and use it in GitHub Desktop.
Map implementation in JavaScript
map = (fn, [head, ...tail]) => (head === undefined ? [] : [fn(head), ...map(fn, tail)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment