javascriptarraysnode.jsjava-stream

How to use streams in JS


I want to manipulate arrays in JS in a similar fashion with Java Streams.

So

arr.map().map().map()

Will do only one iteration.

How can I achieve that without a library?


Solution

  • This is similar to LINQ in DotNet. And there are a lot of library that do that for you already.

    You might want to check out linq.js. It follows the .NET lambda syntax and looks to be well integrated in a Microsoft environment.

    LINQ for JavaScript -

    Pros

    Cons

    Others Similarly Library are: