Comment on Don't use CoffeeScriptComments−hardwaresofton13yHey quick question, maybe you should use map instead of filter?http://www.dotnetspeaks.com/DisplayArticle.aspx?ID=117 (random site with example)map is the functional equivalent of what you're trying to do there, not filter.−jffry13yHis criticism still stands that the JS implementation of (number * number for number in nums) ...is inefficient, and that it could've been translated into much more efficient JS than it was.−city4113yIt's really not inefficient though. Array.map will be much slower in just about all environments.−hardwaresofton13y[EDIT] - People have followed up, turns out the comprehension is faster.
Comments
Hey quick question, maybe you should use map instead of filter?
http://www.dotnetspeaks.com/DisplayArticle.aspx?ID=117 (random site with example)
map is the functional equivalent of what you're trying to do there, not filter.
His criticism still stands that the JS implementation of
...is inefficient, and that it could've been translated into much more efficient JS than it was.It's really not inefficient though. Array.map will be much slower in just about all environments.
[EDIT] - People have followed up, turns out the comprehension is faster.