9/9/2023 0 Comments Stack vs heap javascript![]() Since it doesn't affect the call stack and the event loop, it would be out of the scope of this article to explain how JavaScript's memory allocation works. The JavaScript heap is where objects are stored when we define functions or variables. JavaScript only has one call stack, which is why it can only do one thing at a time. It follows the LIFO principle (Last In, First Out), which means it always processes the call that is on top of the stack first. In summary, the call stack keeps track of the function calls in your code. Uncaught RangeError: Maximum call stack size exceededįunction a ( ) a ( ) In the error messages that you can find in the browser's console, the name of this function is anonymous. I called the context that executes our code main, but this is not how the official name of the function. There are no further statements or function calls in the file, so main exits as well and is being removed from the call stack. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |