AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
How to Store Variables in JavaScript
There are two kind of three-ish types of variables. We're going to be talking about the first type is called global. There's also one that is not as global and it's called local. And these can be accessed only where it is declared. Now usually it's within a function slash function scope. But then there's also this other thing called block scope. This was added in ES6, which is the latest version of JavaScript.