13053 shaares
346 private links
346 private links
The post lists as much iterator variants as possible: how they are constructed and what are they signatures.
Why? We want to do more with iterators:
- async iteration
- adress-sensitive (self-referential) iterators
- iterators that can lend items with a lifetime
- conditionnally terminate early
- take external arguments on each call to
.next()
and also because "I've started hearing talk about potentially (soft-)deprecating Iterator." and the author worked on the Node.js Streams WG through the mid-2010s.