The const keyword is used to create a read-only reference to a value.
const NAME = 'Bob';The value it holds is still mutable, but the variable identifier cannot be reassigned:
const NAME = 'Bob';
NAME = 'Steve';
// TypeError: Assignment to constant variableor redeclared:
const NAME = 'Bob';
const NAME = 'Sally';
// SyntaxError: Identifier 'NAME' has already been declaredVariables declared using the const keyword are block-scoped, meaning they are only accessible within the current block, and any contained sub-blocks.
The value that a variable declared using const holds can only be referenced after it has been defined. This is known as the Temporal Dead Zone.