Created
November 27, 2017 13:48
-
-
Save seogi1004/60b881407a11e8b61e8302548b1a9da4 to your computer and use it in GitHub Desktop.
This file contains 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.each = function(callback) { | |
for(i = 0; i < this.length; i++) { | |
callback(this[i]); | |
} | |
}; | |
var test = [ { name : 'a' }, { name : 'b' }, { name : 'c' } ]; | |
test.each(function(elem) { | |
alert(elem.name); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment