Skip to content

isFunction

Checks if a value is a function.

Available since v1.9.0

import { isFunction } from '@helpers4/type';
isFunction(value: unknown): value is Function
ParameterTypeDescription
valueunknownThe value to check

value is Function — True if value is a function

isFunction(() => {})       // => true
isFunction(function() {})  // => true
isFunction('function')     // => false

View source on GitHub