Last active
July 18, 2019 09:27
-
-
Save noomorph/f9272f1a3f4a9d1f419c2e8dadfb5fe2 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
generator.js:1:9: error: 'identifier' expected after 'function' | |
function* seq(n) { | |
~~~~~~~~^ | |
shell returned 2 |
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
for (var x of [0, 1, 2]) { | |
print(x); | |
} |
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* seq(n) { | |
for (var i = 0; i < n; i++) { | |
yield i; | |
} | |
} | |
for (var x of seq(3)) { | |
print(x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment