Function set
- set<T extends object, P extends PropertyKey>(
target: T,
propertyKey: P,
value: P extends keyof T ? T[P<P>] : any,
receiver?: any,
): boolean Type Parameters
- T extends object
- P extends PropertyKey
Parameters
Returns boolean
- set(
target: object,
propertyKey: PropertyKey,
value: any,
receiver?: any,
): boolean Sets the property of target, equivalent to
target[propertyKey] = value
whenreceiver === target
.Parameters
- target: object
Object that contains the property on itself or in its prototype chain.
- propertyKey: PropertyKey
Name of the property.
- value: any
Optional
receiver: anyThe reference to use as the
this
value in the setter function, iftarget[propertyKey]
is an accessor property.
Returns boolean
- target: object
Sets the property of target, equivalent to
target[propertyKey] = value
whenreceiver === target
.