Skip to content

Instantly share code, notes, and snippets.

@haingdc
Created February 28, 2018 10:40
Show Gist options
  • Select an option

  • Save haingdc/25771bf4627d8a1703cd34dc9afe36d1 to your computer and use it in GitHub Desktop.

Select an option

Save haingdc/25771bf4627d8a1703cd34dc9afe36d1 to your computer and use it in GitHub Desktop.
A Gentle Introduction to Functional JavaScript: Part 2
var map = function(callback, array) {
var newArray = [];
for (var i = 0; i < array.length; i = i + 1) {
newArray[i] = callback(array[i], i);
}
return newArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment