Files
30-seconds-of-code/snippets/js/s/is-function.md
2023-05-07 16:07:29 +03:00

400 B

title, type, language, tags, cover, dateModified
title type language tags cover dateModified
Value is function snippet javascript
type
function
boulder-beach 2020-09-15T16:28:04+03:00

Checks if the given argument is a function.

  • Use typeof to check if a value is classified as a function primitive.
const isFunction = val => typeof val === 'function';
isFunction('x'); // false
isFunction(x => x); // true