UNPKG

571 BJavaScriptView Raw
1var toString = Object.prototype.toString;
2
3/**
4 * Check whether the variable is an array
5 *
6 * @param {any} it The variable to check
7 * @returns {boolean} Returns `true` if it is an array
8 */
9var isArray = function (it) {
10 return '[object Array]' === toString.call(it);
11};
12
13/**
14 * Check whether the variable is an object
15 *
16 * @param {any} it The variable to check
17 * @returns {boolean} Returns `true` if it is an object
18 */
19var isObject = function (it) {
20 return '[object Object]' === toString.call(it);
21};
22
23exports.isArray = isArray;
24exports.isObject = isObject;