Skip to content

Instantly share code, notes, and snippets.

@aereal
Forked from hakobe/generator_quiz.js
Last active October 19, 2018 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aereal/75162ebaacdebde4f547b711e9c3ef40 to your computer and use it in GitHub Desktop.
Save aereal/75162ebaacdebde4f547b711e9c3ef40 to your computer and use it in GitHub Desktop.
oopsを表示させずにhelloのみを表示させる方法を答えよ
function* hello() {
try {
while(true) {
yield 9
yield 3
yield 2
}
} catch(e) {
console.log('oops')
} finally {
console.log('hello')
}
}
const h = hello();
h.next();
h.return('hakobe'); // hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment