Function isPropertyKey

  • Determines whether a value is a JavaScript property key.

    Property keys are strings, numbers, or symbols. Numbers are accepted because exact property-key arrays preserve numeric array indexes and ordinary JavaScript property access coerces numeric object keys as usual.

    Parameters

    • value: unknown

      Candidate property key.

    Returns value is PropertyKey

    Whether value is a string, number, or symbol.