Function isObject

  • Returns true if the given object is strictly an Objectand not aFunction (even though functions are objects in JavaScript). Otherwise, returns false.

    const util = require('util');

    util.isObject(5);
    // Returns: false
    util.isObject(null);
    // Returns: false
    util.isObject({});
    // Returns: true
    util.isObject(() => {});
    // Returns: false

    Deprecated

    Since v4.0.0 - Deprecated: Use value !== null && typeof value === 'object' instead.

    Parameters

    • object: unknown

    Returns boolean

  • Returns true if the given object is strictly an Objectand not aFunction (even though functions are objects in JavaScript). Otherwise, returns false.

    const util = require('util');

    util.isObject(5);
    // Returns: false
    util.isObject(null);
    // Returns: false
    util.isObject({});
    // Returns: true
    util.isObject(() => {});
    // Returns: false

    Deprecated

    Since v4.0.0 - Deprecated: Use value !== null && typeof value === 'object' instead.

    Parameters

    • object: unknown

    Returns boolean

Generated using TypeDoc