JavaScript Iterators and Generators for Pythonistas Quiz
Interactive Quiz ⋅ 10 Questions
By Stephen Gruppetta
In this quiz, you’ll test your understanding of JavaScript Iterators and Generators for Pythonistas.
By working through this quiz, you’ll revisit how JavaScript’s iteration protocol ends a
loop with a done result, why a hand-written iterator has to be iterable too, which
sources replay and which run dry, how to prime a generator before sending it values, how
.take() closes the generator behind it, how iterator helpers keep a pipeline lazy,
and how for await reads an async generator.
Most questions show a short snippet, often next to the Python you’d write, and ask what it does in JavaScript or how to complete the port. Good luck!
The quiz contains 10 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The maximum score is 100%. Good luck!
Related Resources
Course
JavaScript Iterators and Generators for Pythonistas
Port a weather station's sensor feed from Python to JavaScript, and learn to write iterators and function* generators, chain lazy iterator helpers, and read async feeds with for await...of.