By using javascript recursive setTimeout function, is it risky to get the stackoverflow? [duplicate]
问题 This question already has answers here : how does setTimeout prevent potential stackoverflow (2 answers) Why the function called by setTimeout has no callstack limit? (2 answers) Closed last year . By using javascript recursive setTimeout function, is it risky to get the stackoverflow? By trying this example you can see in browser console that the stack grows. Why is it so? var iteration = 0; function bar() { iteration++; console.log("iteration: " + iteration); console.trace(); if(iteration <