Function isFunction

  • Checks if value is a function.

    Parameters

    • value: unknown

      The value to check.

    Returns value is ((...args: unknown[]) => unknown)

    Returns true if value is a function, else false.

    isFunction(Array.prototype.slice); // true
    isFunction(async function () {}); // true
    isFunction(function* () {}); // true
    isFunction(Proxy); // true
    isFunction(Int8Array); // true