yield
Hands back one value from a generator and pauses until the next one is needed.
What does yield do in JavaScript?
yield — Hands back one value from a generator and pauses until the next one is needed.
function* countdown() {
yield 3;
yield 2;
yield 1;
}
Level: Freelancer · More JavaScript terms at this level
Updated