InterviewHubPRO
Section Overview
Q312

Question 312 of 521

Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

60%
JavaScript Internals (521 Qs)•Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

Does the const variable make the value immutable

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']