The object whose properties are to be made non-writable.
Rest
...properties: string[]The names of the properties to be made non-writable.
Will throw an error if any of the specified properties do not exist on the object.
const obj = { a: 1, b: 2, c: 3 };
setNonWritable(obj, 'a', 'b');
obj;;
//=> { a: 1, b: 2, c: 3 }
obj.a = 10;;
//=> Throws an error
obj.b = 20;;
//=> Throws an error
obj.c = 30;;
//=> Works fine
Generated using TypeDoc
Sets the specified properties of an object to be non-writable.