Read Only Properties in ES5
Updated: 2010-07-29 22:58:08
I thought I’d take a quick moment to provide some examples of making object properties read only in EcmaScript 5 (and by extension node.js). There’s several ways to accomplish it, so I’ll just iterate over all the different ways.
Object.freeze
The quickest way to make all properties of an object read only is by calling Object.freeze on [...]