DEV Community

Discussion on: How JavaScript variable scoping is just like multiple levels of government

Collapse
 
guido_dipilla profile image
Guido DiPilla

Well splained Kevin... I do have a question though. Why are we referring to Consts as “variables” since by their definition a Const is immutable shouldn’t they be called Constants? Or am I missing something very fundamental?

Collapse
 
kbk0125 profile image
Kevin Kononenko

Good question, Guido. According to the Microsoft docs, consts are technically variables: docs.microsoft.com/en-us/scripting...

Check out my guide to variables at the bottom. Variables are just containers for values that you initialize. So, a const still fulfills that definition.

blog.codeanalogies.com/2017/12/20/...