Skip to content

Instantly share code, notes, and snippets.

@koron
Last active August 29, 2015 14:01
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 koron/e711d0e1a5ca55ebde8b to your computer and use it in GitHub Desktop.
Save koron/e711d0e1a5ca55ebde8b to your computer and use it in GitHub Desktop.
function x(y) {
return y == 0 ? 0 : y + x(y - 1);
}
console.log(x(10000));
function x(y) {
if (y == 0) {
return 0;
} else {
return y + x(y - 1);
}
}
console.log(x(10000));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment