Created
August 10, 2012 16:34
-
-
Save jhs/3315407 to your computer and use it in GitHub Desktop.
Looping syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var thing in {'foo':1, 'bar':1, 'neat':1}) { | |
console.log('doing ' + thing) | |
doing(thing) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am kind of anti the leading semicolon. Of course I understand its syntactic need. But I kind of feel like, if it's worth iterating through a set of strings, it's worth giving that set a name.
I realize that my point undermines the entire purpose of this Gist. And in the intervening five months I had not even thought to try the new syntax. So it never caught on, even in its author's mind.
P.S. Happy new year!