Skip to main content

Basics 2

Constant Assignment

The const keyword is mentioned both for variables and constants. Another concept often mentioned around constants is (im)-mutability.

The const keyword only makes the binding immutable, that is, you can only assign a value to a const variable once. In JavaScript, only primitive values are immutable. However, non-primitive values can still be mutated.