JavaScript & V8 Internals (536 Qs)•Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)
Does the const variable make the value immutable
mid LevelCode ExamplejavascriptES6+ Modern Syntax
No, the const variable doesn't make the value immutable. But it disallows subsequent assignments(i.e, You can declare with assignment but can't assign another value later)
javascript
const userList = [];
userList.push("John"); // Can mutate even though it can't re-assign
console.log(userList); // ['John']