const
const foo = 123;// Low readability
if (x > 10) {
}
// Better!
const maxRows = 10;
if (x > maxRows) {
}const declarations must be initialized
const foo; // ERROR: const declarations must be initializedLeft hand side of assignment cannot be a constant
Block Scoped
Deep immutability
Prefer const
Last updated