Created
March 1, 2018 14:52
-
-
Save vldvel/086c3ef15cc94ccf34b10b342d0c91a4 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
function * generator() { | |
yield 1; | |
yield 2; | |
yield 3; | |
} | |
const gen = generator(); | |
gen.throw('Something bad'); // Error Uncaught Something bad | |
gen.next(); // {value: undefined, done: true} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment