Created
May 14, 2017 00:20
-
-
Save sharikovvladislav/8aed1ede4b6b95c7f6625d16e86d7c04 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
| <html> | |
| <head> | |
| <title>Test</title> | |
| </head> | |
| <body> | |
| Test iterator | |
| <script> | |
| const gen = function* () { | |
| debugger; const a = yield 10; | |
| debugger; const b = yield; | |
| debugger; yield a + b; | |
| }; | |
| const corutine = gen(); | |
| const result = corutine.next(); | |
| corutine.next(result.value); | |
| console.log(corutine.next(15)); | |
| // { value: 25, done: false } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment