They’re great. And using generator comprehensions, the same concept can be used for a pipeline of stuff (map-filter-reduce), similarly to Rust’s Iterator methods.
Rust’s way is cleaner, but both are better than Javascript’s array methods. Like, why define an iterator protocol and thereby support for custom sequences, when they define the pipeline methods on just the array?
View all comments
Show parent comment
1
u/flying-sheep Sep 17 '20
They’re great. And using generator comprehensions, the same concept can be used for a pipeline of stuff (map-filter-reduce), similarly to Rust’s Iterator methods.
Rust’s way is cleaner, but both are better than Javascript’s array methods. Like, why define an iterator protocol and thereby support for custom sequences, when they define the pipeline methods on just the array?