The React Show cover image

What Actually Happens When You Call A Function?

The React Show

00:00

How Let and Const Work in JavaScript

The environment grows a frame for every function call and shrinks one frame every time a function returns. This process of pushing and popping frames like this, well, it is what we call lexical scoping. There's another type of scoping that some languages use called dynamic scope where the value of an identifier depends on the order in which your code executes. And so if you understand this algorithm of how functions execute, then you intrinsically understand lexical scoped. It also will let us explain how let and const work.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app