isSymbolLike
Test if a value is a symbol or a can-symbol.
isSymbolLike(symbol)
Return true
if symbol
is a native Symbol, or evaluates to a String with a prefix
equal to that of CanJS's symbol polyfill; false
otherwise.
/* ES6 *\/ canReflect.isSymbolLike(Symbol.iterator); // -> true
canReflect.isSymbolLike(canSymbol.for("foo")); // -> true
canReflect.isSymbolLike("@symbol.can.isSymbol"); // -> true (due to polyfill for non-ES6)
canReflect.isSymbolLike("foo"); // -> false
canReflect.isSymbolLike(null); // -> false
canReflect.isSymbolLike(1); // -> false
canReflect.isSymbolLike({}); // -> false
canReflect.isSymbolLike({ toString: function() { return "@symbol.can.isSymbol"; } }); // -> true
Parameters
- symbol
{*}
:maybe a symbol
Returns
{Boolean}
: