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)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

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

Okay