@readonly
Syntax
@readonly
Overview
@readonly documents that a symbol's value should not be modified after it is set. It does not enforce immutability at runtime — it is purely a documentation signal.
Example
/**
* The library version. Do not modify.
* @readonly
* @type {string}
*/
export const VERSION = '2.0.0';
class Config {
/**
* @readonly
* @type {string}
*/
get locale() {
return this._locale;
}
}
See also
Official reference: jsdoc.app/tags-readonly