Created
September 27, 2019 14:48
-
-
Save sbatson5/6491612e9c9835aa346c1c315ae4478e 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* genFunction() { | |
| yield 'Hi there!'; | |
| yield 'Is this working?'; | |
| yield 'Bye ๐'; | |
| }; | |
| const ourMethod = genFunction(); | |
| ourMethod.next(); | |
| // {value: "Hi there!", done: false} | |
| ourMethod.next(); | |
| // {value: "Is this working?", done: false} | |
| ourMethod.next(); | |
| // {value: "Bye ๐", done: false} | |
| ourMethod.next(); | |
| // {value: undefined, done: true} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment