Comment

Comment by iamdanfox

This is familiar to programmers who are used to pointers or references. (Java's `final` does the same thing).

To prevent changes to an object's properties, you could use `Object.freeze()` instead [1]. NB, this is shallow, so a child object of a frozen object can still have its properties changed.

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

parent iamdanfox 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton