Created
March 17, 2021 19:41
-
-
Save ashwinkumar2438/d11b1d3622f5e9a5d861aa9028b25af5 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 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