Skip to content

Instantly share code, notes, and snippets.

@adamnengland
Created November 21, 2012 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamnengland/4122756 to your computer and use it in GitHub Desktop.
Save adamnengland/4122756 to your computer and use it in GitHub Desktop.
Example in coffeescript to force enhanced for loop
adamsList = ['a','b','c']
# Traditional (and more readable)
for x in adamsList
console.log x
#Enhanced for loop (should be faster.
for x in [adamsList.length - 1..0] by -1
console.log x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment