I was reading the ECMAScript Standard, and came across the following passage (section 8.6):
A named accessor property associates a name with one or two accessor functions, and a set of Boolean attributes. The accessor functions are used to store or retrieve an ECMAScript language value that is associated with the property.
Assume I'm using Javasript, which follows the ECMAScript standard.
The standard says: associates a name with one or two accessor functions.
How might I implement a property of an Object in Javascript that has only one of these accessor functions? I.e., the getter accessor function?
For instance, storing a value permanently in an Object property without having the ability to change it. As far as I've been able to work it, Object properties seem to automatically come with both accessor functions.
Is Object.freeze() the only method of accomplishing this?