3 ms·
I am somewhat confused here, I primarily do C# so I am used to IEnumerable and Linq for doing this kind of stuff and you would just do .Where().Select().Average
by SigmundA 7y ago
I am somewhat confused here, I primarily do C# so I am used to IEnumerable and Linq for doing this kind of stuff and you would just do .Where().Select().Average() without worrying about intermediate memory usage. In C# you do this stuff with millions of results from a database (although you would do in the db if you can, but might be a flat file too).
Linq with IEnumerable doesn't necessarily create intermediate list (js arrays) in memory unless it has to like say .OrderBy()
So I basically assumed js was the same since it has generators but its seems map and filter etc don't support them yet?:
https://dev.to/nestedsoftware/lazy-evaluation-in-javascript-with-generators-map-filter-and-reduce--36h5 https://dev.to/nestedsoftware/lazy-evaluation-in-javascript-...
So then you get a solution like this that looks to me very confusing vs a fluent style.
Please tell me I am missing something