3 ms·
Also as an aside, CoffeeScript will only bother to populate the results array if the comprehension is the last thing in the function. If there is anything else
by city41 13y ago
Also as an aside, CoffeeScript will only bother to populate the results array if the comprehension is the last thing in the function. If there is anything else that follows and you never use the result of the comprehension, then it compiles into a simple for loop. This is because CoffeeScript can't know if you actually plan to take advantage of its implicit return in this case.
I have found I've been forced to add a dummy `return` at the end of some of my CS methods because of this. It's one of only a very few complaints I have with the language.