Skip to content

Instantly share code, notes, and snippets.

@getify
Last active August 29, 2015 14:07
Show Gist options
  • Save getify/47f9b04097587e065d9d to your computer and use it in GitHub Desktop.
Save getify/47f9b04097587e065d9d to your computer and use it in GitHub Desktop.
function* is the new function
function
foo(x,y) {
return x * y;
}
foo(3,5); // 15
function*
foo(x,y) {
return x * y;
}
foo(3,5).next().value; // 15
let foo = function(){ return (function*
foo(x,y){
return x * y;
}
).apply(null,arguments).next().value; };
foo(3,5); // 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment