Last active
April 26, 2017 04:56
-
-
Save Ibro/19b3bf251233b6181599b124b610ed86 to your computer and use it in GitHub Desktop.
JavaScript Generators - Simple generator function - Coding Blast - www.codingblast.com
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* simpleGenerator() { | |
yield 1; | |
yield 4; | |
} | |
for (let value of simpleGenerator()) { | |
console.log(value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment