3 ms·
Array.reduce(), Array.filter(), Array.map(), in JavaScript are pretty LINQ-ish if you ask me!
by ConnorLeet 10y ago
Array.reduce(), Array.filter(), Array.map(), in JavaScript are pretty LINQ-ish if you ask me!
- MichaelGG 10y agoThe thing with LINQ is that it can represent itself (reified or 'quoted code), so you can transform it into SQL, GPU instructions, whatever. This isn't a new idea, and F# had it before C# did (and LISP had it before, and others). map/filter/reduce are just basic functional programming elements.
- nightski 10y agoThey are nothing even remotely likely linq. Those functions return the resulting arrays. Linq expressions are not executed until enumerated. This allows you to compose linq expressions without computing intermediate results.
- amyjess 10y agoSounds like Java 8 Streams, then. Streams bear a pretty strong resemblance to translated LINQ.