Iteration, Iterators & Generators

for...of works on anything that follows the iteration protocol: an object with a [Symbol.iterator]() method that returns { next() }. Generators are the easiest way to write such iterators, and they can pause and resume.

Loading NamasteScale