The “const” Deception

TLDRThe keyword in JavaScript is used to declare a constant. This is a core concept in JavaScript, and so many things make more sense when you have a clear understanding of this distinction. When we create a constant with, we can be 100% sure that the variable will never be re-assigned, but no promises are made when it comes to mutation.

5m read time From joshwcomeau.com
Post cover image
Table of contents
IntroductionLink to this heading Variable names as labelsLink to this heading Reassigning our labelsLink to this heading Primitive data typesLink to this heading Additional resources
12 Comments

Sort: