JavaScript 36 🧬 Iterator Interface
The Iterator interface defines a standard way to access elements of a collection one at a time. It’s the mechanism that powers for…of loops, spread syntax, and destructuring in JavaScript. A Quick Look at the Example Key idea: An iterator is an object with a next() method that returns { value, done } on each…