Skip to content

isFunction

The isFunction function checks if the provided value is a function.

Syntax

typescript
isFunction(value: any): value is Function;

Parameters

ParameterTypeDescription
valueanyValue to be checked

Returns

TypeDescription
booleanTrue if it is a function

Examples

typescript
isFunction(function() {}); // => true
isFunction(() => {}); // => true
isFunction(123); // => false

Notes

  • Useful for validation before executing or applying functions.

References

Released under the MIT License.