Created
March 17, 2021 15:11
-
-
Save ashwinkumar2438/e3439d2671e01c40444c619030cbb960 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let race=genRace(); // Generator object created. | |
console.log(race.next()); // @yields {value: "first", done: false} | |
console.log(race.next()); // @yields {value: "second", done: false} | |
console.log(race.next()); // @yields {value: "third", done: false} | |
console.log(race.next()); // @returns {value: "stupid race", done: true} | |
console.log(race.next()); // @returns {value: undefined, done: true} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment