Advertisement
728x90
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
1const userList = [];
2
3userList.push("John"); // Can mutate even though it can't re-assign
4
5console.log(userList); // ['John']Advertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 52
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
308of476