Recursion, Iteration, and JavaScript A Love Story
summary
Shows how ES6 features actually unite recursion and iteration by building an Iterable protocol tree via a generator that uses yield and for...of, turning a clear recursive traversal into an iterable sequence. Demonstrates a tail‑recursive "inception" example that overflows the stack at about 30,000 frames normally, and explains tail call optimization as the engine feature that recycles frames so the 30,000-depth case can run (works only in some engines).
AI-written summary · about
chapters (19)
- 0:00Introduction
- 2:17Programming paradigms
- 2:57Starcrossed lovers
- 3:13Paradigms
- 3:52Iteration
- 5:25Recursion
- 7:40Efficiency
- 9:48Setting
- 11:31Act 1 Iteration
- 13:08Recursive Recursion
- 15:50Iteration Protocols
- 20:05Recursive Energy
- 21:24Act 2 Recursion
- 21:39Recursion in Language
- 27:16The Problem
- 27:39Tail Call Optimization
- 28:28Tail Recursive Function
- 31:32Tail Recursive Inception
- 34:17The Reality
related talks
36mRecursion, Iteration & JavaScript: A love story
01h 04mRecursion has never been invented: A tale of intrigue
28mWhat happens next: a choose-your-own-adventure with iterators
27mA, B, C. 1, 2, 3. Iterables you and me
15mI Yield for Generators
50mGenerators: A Hummer in the Stable?
37mThe JavaScript of tomorrow, today
35mUntangle your code with yield
