Function ownProperty

  • Checks whether property is on object and returns its value. Gives compilation-time check for the existence of key in the specified type.

    Type Parameters

    • T extends SomeObject

    • K extends string | number | symbol

    Parameters

    • obj: T
    • prop: K

    Returns T[K] | undefined

Generated using TypeDoc