Checks if the given argument is a function - Node.js Data Type

Node.js examples for Data Type:function

Description

Checks if the given argument is a function

Demo Code


/**//from  w  w  w.  ja v a 2 s.c o m
 * Checks if the given argument is a function.
 *
 * @param func {*} The argument which will be validated.
 * @returns {boolean}
 *
 */
export function isFunction(func) {
  return typeof func === 'function';
}

Related Tutorials