Created
July 11, 2018 01:09
-
-
Save btg5679/d830f0067e5ae1610459131d38ce636e 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* sample() { | |
yield "simple"; | |
yield "generator"; | |
} | |
var it = sample(); | |
console.log(it.next()); // {value: 'simple, done: false} | |
console.log(it.next()); // {value: 'generator, done: false} | |
console.log(it.next()); // {value: undefined, done: true} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment