Function isSymbol

  • Returns true if the given object is a Symbol. Otherwise, returns false.

    const util = require('util');

    util.isSymbol(5);
    // Returns: false
    util.isSymbol('foo');
    // Returns: false
    util.isSymbol(Symbol('foo'));
    // Returns: true

    Deprecated

    Since v4.0.0 - Use typeof value === 'symbol' instead.

    Parameters

    • object: unknown

    Returns object is symbol

  • Returns true if the given object is a Symbol. Otherwise, returns false.

    const util = require('util');

    util.isSymbol(5);
    // Returns: false
    util.isSymbol('foo');
    // Returns: false
    util.isSymbol(Symbol('foo'));
    // Returns: true

    Deprecated

    Since v4.0.0 - Use typeof value === 'symbol' instead.

    Parameters

    • object: unknown

    Returns object is symbol

Generated using TypeDoc