Function get

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

    Type Parameters

    Parameters

    • target: T

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

    • propertyKey: P

      The property name.

    • Optionalreceiver: unknown

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

    Returns P extends keyof T
        ? T[P]
        : any