JS5040: Assignment to read-only field or property
The code assigns a value to a read-only identifier. This is not allowed because code cannot write to read-only identifiers.
The const statement defines a read-only field or a constant. A function get statement without a matching function set statement defines a read-only property.
To correct this error
Make sure the code does not assign values to read-only identifiers.
Define the field or variable with the var statement to make it assignable.
Add a matching function set statement to the property to make it assignable.