Defines a non-enumerable, non-writable, non-configurable property on a prototype
if it does not already exist, or if the existing property is writable or configurable.
Intended for instance prototype methods (e.g., Array.prototype, String.prototype).
Does not overwrite non-configurable and non-writable properties.
Ensures immutability and hides the property from enumeration.
Type Parameters
Textendsobject
The prototype object type (e.g., Array.prototype).
Defines a non-enumerable, non-writable, non-configurable property on a prototype if it does not already exist, or if the existing property is writable or configurable.
Array.prototype,String.prototype).