index.js
:
function factorial(n, total) {
if (n === 1) return total;
return factorial(n - 1, n * total);
}
console.log(factorial(70000, 1))
And I run it like this:
node --harmony_tailcalls index.js
But it still give me an error:
function factorial(n, total) {
^
RangeError: Maximum call stack size exceeded
why? I read this Node.js tail-call optimization: possible or not? , but still not work.