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
true if the given value is a valid PropertyKey of an object, false otherwise.
true
false
Value to check.
Checks if the given value is a valid PropertyKey of an object (
string
,symbol
, ornumber
).Example
Returns
true
if the given value is a valid PropertyKey of an object,false
otherwise.