Logos DX
    Preparing search index...

    Function isFunction

    • Checks if value is a function.

      Uses instanceof to test if the value is a Function. More reliable than typeof for all function types.

      Parameters

      • a: unknown

        value to check

      Returns a is Function

      true if value is a function

      isFunction(() => {}) // true
      isFunction(function() {}) // true
      isFunction(async () => {}) // true
      isFunction(class MyClass {}) // true
      isFunction('string') // false
      isFunction({}) // false