Created
October 24, 2014 08:34
-
-
Save SFantasy/b56e5616b48ff59ea013 to your computer and use it in GitHub Desktop.
ECMAScript 6 Generator
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 * foo (input) { | |
| var res = yield input; | |
| } | |
| var g = foo(10); | |
| g.next(); // { value: 10, done: false } | |
| g.next(); // { value: undefined, done: true } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment