Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In ES6 there are iterables that one uses `for...of` with. Rauschmayer of 2ality has said that `for...of` should be used instead of forEach and I wonder how that will affect composability in functional programming. I quite like the concept of iteratables and creating data structures that can make use of for of and generators. I just have thought about how that affects functional style programming.


for..of simply desugars into getting an iterator from the iterable and then iterating it, right?

To compose iterables, you'd presumably work with iterators directly instead of the sugar.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: