Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
aaronm67
· 13y ago · 0 comments
In Underscore, you can do something like:
_([ ... ]).map( ... ).filter( ... ).value()
It's not exactly extending the native array...but there are far fewer side effects to doing it this way.
Comments
[–]
WickyNilliams
13y ago
The problem with this is that it's doing multiple iterations. LINQ on the other hand builds up an expression tree that is "compiled" into a single loop when `ToList()` (or some other method which gets the results) is eventually called.