Created
February 28, 2018 10:40
-
-
Save haingdc/25771bf4627d8a1703cd34dc9afe36d1 to your computer and use it in GitHub Desktop.
A Gentle Introduction to Functional JavaScript: Part 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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