DEV Community

Discussion on: Once and for all: const in JavaScript is not immutable

Collapse
 
valentinogagliardi profile image
Valentino Gagliardi

My point is that there are people out there still saying "const is intrinsically immutable". While it's not. As for objects >> Protecting objects from manipulation

Collapse
 
nicknapoli82 profile image
Nicholas Napoli • Edited

I would argue that const is intrinsically immutable. Posing the argument that making a reference immutable, but the data inside is not, is not relevant. Granted. It would be nice if this were default behavior, but knowing why the data inside is not const is important.

This flows down to the engine that js is running on in lower level language land, and that land explains this concept of why well. It should not be a debate.