Function set

  • Sets the property of target, equivalent to target[propertyKey] = value when receiver === target.

    Type Parameters

    Parameters

    • target: T

      Object that contains the property on itself or in its prototype chain.

    • propertyKey: P

      Name of the property.

    • value: P extends keyof T
          ? T[P<P>]
          : any
    • Optionalreceiver: any

      The reference to use as the this value in the setter function, if target[propertyKey] is an accessor property.

    Returns boolean

  • Parameters

    • target: object
    • propertyKey: PropertyKey
    • value: any
    • Optionalreceiver: any

    Returns boolean