Skip to content

Instantly share code, notes, and snippets.

@jasonbellamy
Created October 19, 2016 03:43
Show Gist options
  • Save jasonbellamy/9073ae64584fcbce7a1078bb01cde698 to your computer and use it in GitHub Desktop.
Save jasonbellamy/9073ae64584fcbce7a1078bb01cde698 to your computer and use it in GitHub Desktop.
recursive implementation of mapWith
const mapWith = (fn, [head, ...tail]) => (
(head === void 0) ? [] : [fn(head), ...mapWith(fn, tail)]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment