DEV Community

Cover image for Underrated disparities b/w var, let and const you should be aware of [Part-1]
Kotesh_🔯
Kotesh_🔯

Posted on

Underrated disparities b/w var, let and const you should be aware of [Part-1]

We all know that var, let and const are keywords in Javascript with their own behaviours while declaring variables using them, such as SCOPING & RE-DECLARATION bla..bla..bla...

But here I will just give keep it short and simple with multiple parts, so that you won't get lost in an overwhelming bunches of words and sentenses.
so get ready for a short series of content chunks⚡

THE SCOPE 🔭

That's just a set of curly braces { } 👇🏻

Representation of Scope in Javascript
If they belong to a function then it's called as Function Scope 👇🏻

Representation of Function Scope in Javascript
and the space which is outside of both Function-scope and scope (Just a curly-brace set Shown in first image), is the Global Scope 👇🏻

Representation of Global Scope in Javascript

And that's a short and sweet overview of the SCOPE.

Top comments (0)