1 | var 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 | */
|
9 | var 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 | */
|
19 | var isObject = function (it) {
|
20 | return '[object Object]' === toString.call(it);
|
21 | };
|
22 |
|
23 | exports.isArray = isArray;
|
24 | exports.isObject = isObject;
|