Skip to content

Instantly share code, notes, and snippets.

@ashwinkumar2438
Created March 17, 2021 15:11
Show Gist options
  • Save ashwinkumar2438/e3439d2671e01c40444c619030cbb960 to your computer and use it in GitHub Desktop.
Save ashwinkumar2438/e3439d2671e01c40444c619030cbb960 to your computer and use it in GitHub Desktop.
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