loading...

re: Demystifying "const" variables in JavaScript VIEW POST

FULL DISCUSSION
 

To add to this - if you want your object to actually be immutable, you can use Object.freeze. If the object contains other objects, this will only freeze the first level of values. You can use the deep-freeze package to recursively freeze the object.

code of conduct - report abuse