ES6 const is not constant or immutable

10 Jan 2019

I gave a quick talk on JS a while ago on hoisting in JS and while discussing on how hoisting apply to variable declarations, we imminently reached to ES6’s let and const. So we began talking about the difference between var, let and const and how const is not really a constant or immutable.

What is const

Constants are block-scoped, much like variables defined using the let statement. The value of a constant cannot change through reassignment, and it can’t be redeclared.