Skip to content

Instantly share code, notes, and snippets.

@mkuklis
Created June 17, 2011 05:35
Show Gist options
  • Save mkuklis/1030922 to your computer and use it in GitHub Desktop.
Save mkuklis/1030922 to your computer and use it in GitHub Desktop.
JavaScript test for Array
if (typeof Array.isArray === "undefined") {
Array.isArray = function (arg) {
return Object.prototype.toString.call(arg) === "[object Array]";
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment