37 questions for “Iterators & Generators”

Found in 1 field. Select a question to see its full answer.

Information Technology

37 questions in 4 technologies

#QuestionTechnologyTopicLevel
1How were generators historically used to write asynchronous code before async/await existed? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsAdvanced
2Can you use a for...of loop directly on a generator's return value? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsBeginner
3How do you implement an infinite sequence using a generator, and why is this safe? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsIntermediate
4What makes an object 'iterable' in JavaScript? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsBeginner
5How do you write a basic generator function? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsBeginner
6How does yield pause and resume execution, and what does it return to the caller? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsIntermediate
7How do you delegate from one generator to another using yield*? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsIntermediate
8How do you use generator.throw() and generator.return() to control a running generator externally? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsAdvanced
9How would you implement a custom Symbol.iterator for a tree data structure to enable depth-first traversal with for...of? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsAdvanced
10What's the performance and memory advantage of a generator-based lazy pipeline over building intermediate arrays with map/filter? JavaScript › Iterators & GeneratorsJavaScriptIterators & GeneratorsAdvanced