Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created May 4, 2016 17:41
Show Gist options
  • Save pedrofurla/f06dd41c6ff489ab43f88d6bc50c7fcc to your computer and use it in GitHub Desktop.
Save pedrofurla/f06dd41c6ff489ab43f88d6bc50c7fcc to your computer and use it in GitHub Desktop.
function *gen(x) {
var i = yield(x + 1);
console.log(i, typeof i);
var y = 2 * i;
var z = yield (y/3);
return x + y +z
}
var g = gen(5)
g.next()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment