News for hackers. Stuff that matters.
Re:Poll: Have you moved from JavaScript to CoffeeScript? by henryl on Wednesday June 22, 2011 @03:35PM (#2684756)
JavaScript's for-in construct is not the same as iterating through all elements in the array as it will enumerate over all of the object's properties (see here: http://stackoverflow.com/questions/500504/javascript-for-in-...)

The other "complexities" in the compiled JavaScript are there for perf reasons (not accessing the "length" properties in the condition portion of the for loop, for example).

Your comment underlies why some users find CoffeeScript useful in dealing with some of the idiosyncrasies and performance minutiae associated with JavaScript.

Re:Poll: Have you moved from JavaScript to CoffeeScript? by gavinlynch on Wednesday June 22, 2011 @06:09PM (#2685568)
Right, for..in is not the same as iterating through all elements in an array. Understood. But it works excellent in the example the OP created and in my follow-up example.

And I agree that accessing the length property in the conditional is not ideal.

I guess it comes down to this for me: I don't feel that Javascript has an unduly burdensome list of common idiosyncrasies to justify developing in a 'different language'/syntax that compiles into javascript and changing my development workflow to reap said questionably useful benefits.

Perhaps I am simply not the intended audience.