3 ms·
Hey quick question, maybe you should use map instead of filter? http://www.dotnetspeaks.com/DisplayArticle.aspx?ID=117 http://www.dotnetspeaks.com/DisplayArtic
by hardwaresofton 13y ago
Hey quick question, maybe you should use map instead of filter?
http://www.dotnetspeaks.com/DisplayArticle.aspx?ID=117 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.
- jffry 13y agoHis 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.
- city41 13y agoIt's really not inefficient though. Array.map will be much slower in just about all environments.
- hardwaresofton 13y ago[EDIT] - People have followed up, turns out the comprehension is faster.