Skip to main content

isFunction

Callable

  • isFunction<T>(f: unknown): f is T

  • Checks if f is classified as Function.

    Example

    isFunction(() => true))
    // => true

    isFunction("foobar")
    // => false

    Alternatives


    Type parameters

    • T: Function

    Parameters

    • f: unknown

    Returns f is T

    true if x is a Function, false otherwise.