UNPKG

454 BJavaScriptView Raw
1/**
2 * Tests whether or not an object is an array.
3 *
4 * @private
5 * @param {*} val The object to test.
6 * @return {Boolean} `true` if `val` is an array, `false` otherwise.
7 * @example
8 *
9 * _isArray([]); //=> true
10 * _isArray(null); //=> false
11 * _isArray({}); //=> false
12 */
13module.exports = Array.isArray || function _isArray(val) {
14 return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]';
15};
\No newline at end of file