🔰iteration
JS ⟩ iteration
three types that are related to iteration:
iterable - object that can make iterators to loop over itself.
iterator - object that can produce the next iteration result.
iteration result - object that holds the result 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 - prototype 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 .
Last updated