UNPKG

domtastic

Version:

Small, fast, and modular DOM and event library for modern browsers.

30 lines (25 loc) 634 B
/** * @module Type */ /* * Determine if the argument passed is a Javascript function object. * * @param {Object} [obj] Object to test whether or not it is a function. * @return {boolean} * @example * $.isFunction(function(){}); // true * @example * $.isFunction({}); // false */ export const isFunction = obj => typeof obj === 'function'; /* * Determine whether the argument is an array. * * @param {Object} [obj] Object to test whether or not it is an array. * @return {boolean} * @example * $.isArray([]); // true * @example * $.isArray({}); // false */ export const isArray = Array.isArray;