Created
February 15, 2016 19:11
-
-
Save jbonhag/dee25133a245110ee354 to your computer and use it in GitHub Desktop.
Add map function to HTMLCollection
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
HTMLCollection.prototype.map = function(f) { | |
var result = []; | |
for (var i = 0; i < this.length; i = i + 1) { | |
el = elements[i]; | |
result.push(f(el)); | |
}; | |
return result; | |
} |
deancasalena
commented
Sep 30, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment