Check for Array-ness


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if (typeof Array.isArray === "undefined") {
  2. Array.isArray = function (arg) {
  3. return Object.prototype.toString.call(arg) === "[object Array]";
  4. };
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.