UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

20 lines (19 loc) 490 B
//#region src/predicate/isFunction.ts /** * Checks if `value` is a function. * * @param value The value to check. * @returns Returns `true` if `value` is a function, else `false`. * * @example * isFunction(Array.prototype.slice); // true * isFunction(async function () {}); // true * isFunction(function* () {}); // true * isFunction(Proxy); // true * isFunction(Int8Array); // true */ function isFunction(value) { return typeof value === "function"; } //#endregion export { isFunction };