function isSymbol
Jump to headingisSymbol(object: unknown): object is symbol
Deprecated
Returns true
if the given object
is a Symbol
. Otherwise, returns false
.
import util from 'node:util';
util.isSymbol(5);
// Returns: false
util.isSymbol('foo');
// Returns: false
util.isSymbol(Symbol('foo'));
// Returns: true
Parameters Jump to heading
Jump to headingobject: unknown
Return Type Jump to heading
object is symbol