iteration
Last updated
Was this helpful?
Last updated
Was this helpful?
⟩ iteration
three types that are related to iteration:
iterable - object that can to loop over itself.
iterator - object that can .
iteration result - object that holds the of each step of the iteration.
custom extension
next() - iterators must implement next() method.
make-iterator method of an iterable - iterables can make iterators.
iterators only iterate once❗️ - iterators only iterate once.
iterable iterator - an iterator that is itself iterable.
IteratorPrototype - of all built-in iterators.
Iterator - extension for (built-in) iterators.
three types that are related to the iteration.
iterable - object that can be iterated.
iterator - object that performs the iteration.
iteration result - object that holds the result of each step of the iteration.
Generator - objects returned by generator function.
generator function - return .
replit:
⟩
( = makeIterator in Swift )
ExploringJS ⟩ ⭐️
2ality ⟩