Nerd For Tech
Published in

Nerd For Tech

Visual representation of the JS event Loop

The Call Stack and Memory Heap explained.

The call stack and Heap won’t interfere with your day-to-day workflow. However, it is crucial to understand call stack and memory heap. They are foundational concepts that every software engineer should understand. Just keep in mind that the Stack and Heap are not exclusive concepts to JavaScript. Other low-level languages use such as C and C++ these languages use stack and Heap as well.

The call stack is for our application. Without it, JavaScript wouldn’t know what to call or when.

Let’s review an example of how we can communicate to the call stack.

What is the memory Heap?

The Heap is responsible for storing our data. This is where the happens.

let’s review the following

Since all the JavaScript engines are all different, where variables are allocated isn’t always the same. For the most part, you can think of it like this. More simple variables will be stored in the stack, and more complex variables such as Objects, Arrays, and more complex data structures.

--

--

--

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Recommended from Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cameron J. Leverett

Cameron J. Leverett

I love tackling new and exciting challenges and working with software because it’s consistently changing, which is exciting.

More from Medium