isArray.js 468 B

12345678910111213141516
  1. import defined from './defined.js';
  2. /**
  3. * Tests an object to see if it is an array.
  4. * @exports isArray
  5. *
  6. * @param {*} value The value to test.
  7. * @returns {Boolean} true if the value is an array, false otherwise.
  8. */
  9. var isArray = Array.isArray;
  10. if (!defined(isArray)) {
  11. isArray = function(value) {
  12. return Object.prototype.toString.call(value) === '[object Array]';
  13. };
  14. }
  15. export default isArray;