Egghead Instructor Preethi Kasireddy

Preethi Kasireddy

A passionate software engineer that loves teaching others everything I learn. In my previous life, I was a venture capitalist at Andreessen Horowitz, where I fell in love with passionate engineers & entrepreneurs and realized I wanted to be "one of them" :)

Support Preethi's Free Lessons
become a member today

Browse Preethi Kasireddy's lessons.

showing 1 lessons...

JavaScript's Call Stack

js tutorial about JavaScript's Call Stack

JavaScript's Call Stack

3:45 js

JavaScript has a concurrency model based on an "event loop". Yet, we know that JavaScript is single-threaded, which means only one task can happen at a time. To understand how JavaScript has a concurrent model yet is single threaded, we'll take a look at how the browser is working to interpret your JavaScript.

Specifically, we'll start by looking at the Stack implemented by browser engines (e.g. V8 or SpiderMonkey). The JavaScript engines use the call stack to keep track of what functions are running -- a function is added to a stack when the engine reaches a function that needs to be executed, and it cleared from the stack when the function returns.

Joel's Head
Why are we asking?