🔰iterator
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
object that can produce the next iteration result.
has next() method that returns an iteration result. (similar to iterator objects conforming to IteratorProtocol in Swift)
iterators:
- returns an iterator of matching results.
objects returned by s.
array., map., ...
s don't always run all the way to the end:
a for-of loop might be terminated with a break, return, or an exception
All iterator protocol methods
when destructuring an iterable, the next() method (of an iterator) is only called enough times to obtain values for each variable.
throw()
are expected to return an iteration result object.
IteratorPrototype - prototype of all built-in iterators.