Me and someone were debating over how recursive functions will cause a Maximum call stack size exceeded
error. I made a function:
function e(){
console.log("e");
e();
}
e();
that uses a recursive loop to call itself. The person I was debating with said that it works because "It could be that your console.log
's buffer is slow to write and so therefore it's just prolonging the stack overflow for quite a while." What exactly does this mean? I know that pretty much any code inside a recursive function prevents (or elongates the time until) a Maximum call stack size exceeded
error.
Why is this true?