Created
November 13, 2015 19:30
-
-
Save mhingston/4a8abe064290cc22a2ba to your computer and use it in GitHub Desktop.
Faster implementation of native Array.forEach method
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.forEach = function(fn) | |
{ | |
"use strict" | |
var l = this.length | |
for(var i = 0; i < l; ++i) | |
{ | |
fn(this[i], i, this) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment