JavaScript Jabber cover image

JSJ 449: The Things Every JavaScript Developer Must Know

JavaScript Jabber

00:00

JavaScript

Up until ES6 with the exception of try catch, we really had function level scoping. So if you have var a equals three, what actually happens is that the declaration of var gets pulled to the top, but var is actually assigned undefined. But as Chuck correctly said, if it's let or const, then there are two changes. First of all, it's block scoped rather than function scoped. It can also extend a little bit outside of that block that you can put open and close curlies anywhere in the code to create scope.

Play episode from 07:29
Transcript

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