Start of main content
Value is function
JavaScript, Type, Function · Sep 15, 2020

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');
isFunction(x => x);
More like this

Learn everything about JavaScript functions with this ES6 snippet collection.
Collection · 96 snippets

Checks if the given argument is an async
function.
JavaScript, Type · Oct 20, 2020

Checks if the given argument is a generator function.
JavaScript, Type · Oct 20, 2020

Checks if the given argument is a string.
Only works for string primitives.
JavaScript, Type · Oct 20, 2020