In Scala, view
allows preventing creating an entirely new collection.
e.g. In Scala, what does "view" do?
Is there something similar in JavaScript? My use case:
x = inputValue.split(",").map(x => x.trim()).filter(f1).map(f2)
As you can see in the above code, 2 intermediate collections would be created. Is there some way in JavaScript to avoid creating the above intermediate collections?