Checks if the given value is a valid PropertyKey of an object (string, symbol, or number).
string
symbol
number
isPropertyKey("Vangware"); // trueisPropertyKey(1); // trueisPropertyKey(Symbol("Vangware")); // trueisPropertyKey({}); // false Copy
isPropertyKey("Vangware"); // trueisPropertyKey(1); // trueisPropertyKey(Symbol("Vangware")); // trueisPropertyKey({}); // false
Value to check.
true if the given value is a valid PropertyKey of an object, false otherwise.
true
false
Checks if the given value is a valid PropertyKey of an object (
string
,symbol
, ornumber
).Example