DEV Community

Cover image for Call Stack in Javascript
 Rahul Gupta
Rahul Gupta

Posted on

2 1

Call Stack in Javascript

Call Stack is a data structure for javascript interpreters to keep track of function calls in the program. It has two major actions:

Whenever you call a function for its execution, you are pushing it to the stack.
Whenever the execution is completed, the function is popped out of the stack.

`function hungry() {
eatFruits();
}
function eatFruits() {
return "I'm eating fruits";
}

// Invoke the hungry function
hungry(); `

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay