Skip to content

Instantly share code, notes, and snippets.

@chriswrightdesign
Created January 7, 2014 21:45
Show Gist options
  • Save chriswrightdesign/8307471 to your computer and use it in GitHub Desktop.
Save chriswrightdesign/8307471 to your computer and use it in GitHub Desktop.
Cached array length javascript for better performance
for (i = 0, len = arr.length; i < len; i++) {
//Calculated once
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment