Skip to content

Instantly share code, notes, and snippets.

@colintoh
Last active August 29, 2015 14:07
Show Gist options
  • Save colintoh/e97befa867678265b5ac to your computer and use it in GitHub Desktop.
Save colintoh/e97befa867678265b5ac to your computer and use it in GitHub Desktop.
For loop with cached length
var arr = "overzealous optimization programming".split("");
for(var i = 0, l = arr.length; i < l; i++) {
console.log(arr[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment