Skip to content

Instantly share code, notes, and snippets.

@fxxkscript
Created December 19, 2012 02:40
Show Gist options
  • Save fxxkscript/4333899 to your computer and use it in GitHub Desktop.
Save fxxkscript/4333899 to your computer and use it in GitHub Desktop.
判断数组类型
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