What happens next: a choose-your-own-adventure with iterators
summary
Demonstrates that ES6 iterable and iterator protocols actually power for‑of, spread, and array destructuring and that generators plus yield delegation* consume iterables; shows a broken app where Array.prototype[Symbol.iterator] is maliciously overridden so next() returns undefined, builds a custom iterable (track) returning an object with next() to restore cable‑car stops, and proves it works; notes async iterators and generators for streaming.
AI-written summary · about
chapters (4)
related talks
27mA, B, C. 1, 2, 3. Iterables you and me
50mGenerators: A Hummer in the Stable?
51mThe Miracle of Generators
15mI Yield for Generators
38mRecursion, Iteration, and JavaScript A Love Story
31mPromises and Generators: control flow utopia
35mUntangle your code with yield
24mGenerating async iterators is ekstreamly easy, I Promise ;)
