What is an error stack trace?

https://www.codecademy.com/paths/front-end-engineer-career-path/tracks/fecp-22-javascript-syntax-part-ii/modules/wdcp-22-learn-javascript-syntax-errors-and-debugging/articles/thinking-about-errors-in-your-code-differently

What is an error stack trace? I think it has something to do with ‘stack and heap’ but i’m not sure.

It is not presumable that people know what an ‘error stack trace’ means.

Thanks in advance.

Hi,
When a program is running it’s likely to be calling different functions, libraries, other programs, etc.
It keeps track of where it is by adding each call to a stack trace and then popping them off when it’s done with that bit. That way, when the program hits an error it can show you what it was doing, and where it was when it broke.

For instance, you could have a program that gives an error whilst in a function but when you check, the function seems fine.
The trace means you could see where it was called from and track the error back up from there.

Hope that helps

1 Like

Okay, thanks for the info.