Last active
December 7, 2015 12:20
-
-
Save botic/a3ee38b4c0dbaa711954 to your computer and use it in GitHub Desktop.
RingoJS - Iterators and Generators
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
| Philipps-MBP:~ philipp$ ringo | |
| >> function* foo(a) { a = a + 1; yield a; } | |
| SyntaxError: missing ( before function parameters. | |
| <stdin>, line 14: missing ( before function parameters. | |
| function* foo(a) { a = a + 1; yield a; } | |
| ^ | |
| >> function foo(a) { a = a + 1; yield a; } | |
| >> var x = foo(1); | |
| >> x.next(); | |
| 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment