Skip to main content
function isSymbol
isSymbol(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

object: unknown

Return Type

object is symbol
Back to top