Function isBoolean

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

    const util = require('util');

    util.isBoolean(1);
    // Returns: false
    util.isBoolean(0);
    // Returns: false
    util.isBoolean(false);
    // Returns: true

    Deprecated

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

    Parameters

    • object: unknown

    Returns object is boolean

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

    const util = require('util');

    util.isBoolean(1);
    // Returns: false
    util.isBoolean(0);
    // Returns: false
    util.isBoolean(false);
    // Returns: true

    Deprecated

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

    Parameters

    • object: unknown

    Returns object is boolean

Generated using TypeDoc