There's the const definition in Exploring ES6 by Dr. Axel Rauschmayer:
constworks like let, but the variable you declare must be immediately initialized, with a value that can’t be changed afterwards. […]const bar = 123; bar = 456; // TypeError: `bar` is read-only
and then he writes
Pitfall: const does not make the value immutable
constonly means that a variable always has the same value, but it does not mean that the value itself is or becomes immutable.
I am little confused with this pitfall. Can any one clearly define the const with this pitfall?
const x = "immutable"is immutable, becauseStringis immutable.constprohibits merely reassignment. – ftor yesterday