Skip to content

Instantly share code, notes, and snippets.

@getify
Created September 29, 2010 16:20
Show Gist options
  • Save getify/603041 to your computer and use it in GitHub Desktop.
Save getify/603041 to your computer and use it in GitHub Desktop.
for (var i = 0, j = foo.length; i < j; i++) {
// do stuff
}
for (var i = foo.length; i;) {
// first usage in loop: blah[--i]
// do stuff slightly faster in reverse order
}
@bentruyman
Copy link

That might be the case in the particular version of Chrome 6 you were using to test. In the tests I performed, however, there was a greater than 1% difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment