Source: Core/isArray.js

  1. /*global define*/
  2. define([
  3. './defined'
  4. ], function(
  5. defined) {
  6. 'use strict';
  7. /**
  8. * Tests an object to see if it is an array.
  9. * @exports isArray
  10. *
  11. * @param {Object} value The value to test.
  12. * @returns {Boolean} true if the value is an array, false otherwise.
  13. */
  14. var isArray = Array.isArray;
  15. if (!defined(isArray)) {
  16. isArray = function(value) {
  17. return Object.prototype.toString.call(value) === '[object Array]';
  18. };
  19. }
  20. return isArray;
  21. });