Skip to content

Instantly share code, notes, and snippets.

@haingdc
Created March 13, 2018 04:52
Show Gist options
  • Select an option

  • Save haingdc/41957d86d48cf4cacfb088af3e38fa67 to your computer and use it in GitHub Desktop.

Select an option

Save haingdc/41957d86d48cf4cacfb088af3e38fa67 to your computer and use it in GitHub Desktop.
A Gentle Introduction to Functional JavaScript: Part 3
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