Eaze interview question

In so many words the question was: "In Javascript, what do you call a function that can pause execution while the runtime executes other tasks, then continues execution later at the point that the function last left off?" Then a follow up: "What is the syntax for such a function?"

Interview Answer

Anonymous

3 May 2018

A generator function. Make sure to mention something about the `yield` keyword and how it behaves versus `return`. Follow up answer: `function* functionName() { yield return }` The asterisk and `yield` are the most important.