Function isFunction

  • Returns true if the given object is a Function. Otherwise, returnsfalse.

    const util = require('util');

    function Foo() {}
    const Bar = () => {};

    util.isFunction({});
    // Returns: false
    util.isFunction(Foo);
    // Returns: true
    util.isFunction(Bar);
    // Returns: true

    Deprecated

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

    Parameters

    • object: unknown

    Returns boolean

  • Returns true if the given object is a Function. Otherwise, returnsfalse.

    const util = require('util');

    function Foo() {}
    const Bar = () => {};

    util.isFunction({});
    // Returns: false
    util.isFunction(Foo);
    // Returns: true
    util.isFunction(Bar);
    // Returns: true

    Deprecated

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

    Parameters

    • object: unknown

    Returns boolean

Generated using TypeDoc