Skip to main content
InterviewHubPRO
Section Overview
Q312

Question 312 of 536

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

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