Skip to content

Instantly share code, notes, and snippets.

@ashwinkumar2438
Created March 17, 2021 19:41
Show Gist options
  • Save ashwinkumar2438/d11b1d3622f5e9a5d861aa9028b25af5 to your computer and use it in GitHub Desktop.
Save ashwinkumar2438/d11b1d3622f5e9a5d861aa9028b25af5 to your computer and use it in GitHub Desktop.
let yielder=function*(){
yield yield yield 'first';
}
let race=yielder();
console.log(race.next()); //@yields {value: "first", done: false}
console.log(race.next('second')); //@yields {value: "second", done: false}
console.log(race.next('third')); //@yields {value: "third", done: false}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment