IsArray.js 410 B

1234567891011121314
  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var $Array = GetIntrinsic('%Array%');
  4. // eslint-disable-next-line global-require
  5. var toStr = !$Array.isArray && require('call-bind/callBound')('Object.prototype.toString');
  6. // https://ecma-international.org/ecma-262/6.0/#sec-isarray
  7. module.exports = $Array.isArray || function IsArray(argument) {
  8. return toStr(argument) === '[object Array]';
  9. };