Skip to content

Instantly share code, notes, and snippets.

@nickbalestra
Last active October 9, 2015 00:53
Show Gist options
  • Save nickbalestra/f94181fbe769b128d1d3 to your computer and use it in GitHub Desktop.
Save nickbalestra/f94181fbe769b128d1d3 to your computer and use it in GitHub Desktop.
Recursive Reduce and Each
function recursiveEach(list, iterator) {
if (list.length === 0) {
return undefined;
}
iterator(list[0]);
return recursiveEach(list.slice(1), iterator);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment