Function isFunction

  • Determines if the given value is a function.

    Since

    vx.x.x

    Returns

    Whether the given value is a function.

    Example

    // is a function
    const exampleFn = () => {}
    console.log(
    isFunction(exampleFn)
    )
    => true

    Example

    // is not a function
    const example = 'example'
    console.log(
    isFunction(example)
    )
    => false

    Parameters

    • value: unknown

      The value to check.

    Returns boolean