Created
January 27, 2019 11:53
-
-
Save flexaddicted/3869a2927e69ccfd7b1c04328cbceb5d to your computer and use it in GitHub Desktop.
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
Array.prototype.myMap = function(fn) { | |
const elements = []; | |
for(let i = 0; i < this.length; i++) { | |
elements.push(fn(this[i])); | |
} | |
return elements; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment