-
-
Save ahamedali95/83aaa6aa3fbfbfcce606a113c6b0211f to your computer and use it in GitHub Desktop.
This file contains 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
function *generator(i) { | |
yield i; | |
yield i + 1; | |
} | |
const g = generator(10); | |
console.log(g.next()); //=> {value: 10, done: false} | |
console.log(g.next()); //=> {value: 11, done: false} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment