Skip to content

Instantly share code, notes, and snippets.

@InPermutation
Created March 5, 2013 01:40
Show Gist options
  • Select an option

  • Save InPermutation/5087328 to your computer and use it in GitHub Desktop.

Select an option

Save InPermutation/5087328 to your computer and use it in GitHub Desktop.
An example of tail recursion that is not optimized by Node.
var r = recurse(process.argv[2] || 5000, 0);
console.log('found', r);
function recurse(n, j) {
if(n>0) return recurse(n-1, j+1);
else return j;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment