Created
March 1, 2018 10:14
-
-
Save vldvel/f4410a638736dfa0ec651cb03c8038b4 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
| function * generator() { | |
| yield 5; | |
| } | |
| const gen = generator(); | |
| gen.next(); // {value: 5, done: false} | |
| gen.next(); // {value: undefined, done: true} | |
| gen.next(); // {value: undefined, done: true} - all other calls will produce the same result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment