Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why async recursion shows call stack building up in the browser?

While I totally agree with the accepted answer on this SO post, I need to know if asynchronous recursion really creates a brand new call stack, why does it show the call stack building up in the browser in the following screenshot? To be fair, the call stack seems to stop growing after 32 recursions. Here’s the sample code.

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Async does create new stacks.

Your browser’s dev tools glue those async frames together for you as a debugging convenience.

You can turn it off in the dev tools’ preferences; see eg. https://developer.chrome.com/blog/new-in-devtools-60/#async-stacks

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading