It’s quiz night at the Lantern, and Marco, the host, keeps score for five teams. Each team needs a running total that nothing else can change, the winner should be announced exactly once, the big screen asks for each team’s best round again and again, and a round’s points hide inside categories that hold sub-categories. In this course, you’ll build the small kit of functions that handles all of it.
Every function call puts a frame on the call stack, and every name is looked up in the scope where its code was written. Once you can see both pictures, closures stop being magic: a function made inside a call keeps using that call’s variables after the call returns. You’ll learn how to:
- Follow nested and recursive calls on the call stack, and read a stack trace.
- Look up names where they’re written, and use names safely before their line.
- Build functions that remember state between calls, with factories,
once()andmemoize(). - Read and split method chains, wrap functions to add behavior, and compose small functions into pipelines.
- Build Marco’s scorekeeping kit, and explain the choices behind it.
Each section mixes text lessons and short videos, and ends with an exercise you write in the browser, where automated tests check your code.
In the project, you build makeTeamScorer() so each team keeps its own total, wrap the winner announcement with once(), memoize the best-round lookup, total a round’s nested categories recursively, and rank the final standings with a pipeline. Then you explain your kit to the AI mentor, make an unseen change, and take a quiz.
This course is for programmers who can write basic programs in Node, who can hand arrow functions to array methods like .map(), .filter() and .reduce(), who can work with nested data, Map and Set, and who know when two names share one object. You’ll need a current Node LTS, a terminal, and any editor.
What’s Included:
- 23 Lessons
- Video Subtitles and Full Transcripts
- Translated Subtitles in 8 Languages
- 2 Downloadable Resources
- Interactive Quiz to Check Your Progress
- 6 Hands-On Coding Exercises
- Q&A With JavaScript Experts: Ask a Question
- Certificate of Completion
Downloadable Resources:
Related Learning Paths: