Created
August 15, 2016 06:05
-
-
Save robbestad/5e91fab5990d16e48813ebb2277cb166 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(...seq) { | |
| while (true) { | |
| for (let item of seq) { | |
| yield item; | |
| } | |
| } | |
| } | |
| let seq = generator('1','2','3'); | |
| for (let i = 0; i < 5; i++) { | |
| console.log(gen.next().value); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment