Skip to content

Instantly share code, notes, and snippets.

@casparkleijne
Created January 19, 2011 08:56
Show Gist options
  • Save casparkleijne/785891 to your computer and use it in GitHub Desktop.
Save casparkleijne/785891 to your computer and use it in GitHub Desktop.
fast each.
Array.prototype.each = function (f) {
var j = this.length,
k = j % 8;
for(j; j > k; 0){
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
}
for(j; j > 0; 0){
f(this[--j],j);
}
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment