With const, the variable is declared only once and can not be changed; it becomes read-only
Javascript variable declarations ‘let’ and ‘const’
Brian Moore
62
Some const variables can be changed. It doesn’t become a read only variable, more of a protected first layer.
If you create a string with const you won’t be able to change the string but if you create an empty object with const you can then add values to the object and change those values.
For example, you can do the following:
const obj = {};
const.hello = ‘hello’;
const.hello = ‘bye’;
console.log(const) // Object {hello: “bye”}