Skip to content

Instantly share code, notes, and snippets.

@mhingston
Created November 13, 2015 19:30
Show Gist options
  • Save mhingston/4a8abe064290cc22a2ba to your computer and use it in GitHub Desktop.
Save mhingston/4a8abe064290cc22a2ba to your computer and use it in GitHub Desktop.
Faster implementation of native Array.forEach method
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