Function isPropertyKey

  • Checks if the given value is a valid PropertyKey of an object (string, symbol, or number).

    Example

    isPropertyKey("Vangware"); // true
    isPropertyKey(1); // true
    isPropertyKey(Symbol("Vangware")); // true
    isPropertyKey({}); // false

    Returns

    true if the given value is a valid PropertyKey of an object, false otherwise.

    Type Parameters

    • Actual

    Parameters

    • input: PropertyKey | Actual

      Value to check.

    Returns input is PropertyKey