Skip to the content.

$.isFunction(value)

Type guard that returns true when the value is a function.

Importing this module attaches isFunction to the $ factory as a static helper, mirroring jQuery’s $.isFunction. The underlying check is a single typeof value === "function" guard, so it stays tree-shakeable.

Signatures

$.isFunction(value: unknown): value is Function;

Parameters

Returns

true if value is callable (typeof value === "function"), otherwise false.

Examples

import $ from "dabbyjs";
import "dabbyjs/utils/isfunction/isfunction";

if ($.isFunction(handler)) {
    handler();
}

Notes

Included in the full build. Prefer $.isPlainObject() for object-shape checks.