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.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.