Check if a value is a function (including async functions). Returns true for both regular and async functions, false otherwise.
The value to check
Returns true if value is a function, false otherwise
import isFunction from '~/utils/isFunction';isFunction(() => {}); // trueisFunction(async () => {}); // trueisFunction(function() {}); // trueisFunction(''); // falseisFunction({}); // false Copy
import isFunction from '~/utils/isFunction';isFunction(() => {}); // trueisFunction(async () => {}); // trueisFunction(function() {}); // trueisFunction(''); // falseisFunction({}); // false
Check if a value is a function (including async functions). Returns true for both regular and async functions, false otherwise.