Skip to content

Instantly share code, notes, and snippets.

@jation
Last active December 21, 2015 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jation/6260255 to your computer and use it in GitHub Desktop.
Save jation/6260255 to your computer and use it in GitHub Desktop.
兼容ES3和ES5的Array.isArray()方法
if(typeof Array.isArray==="undefined"){
Array.isArray = function(args){
return Object.prototype.toString.call(args) === "[object Array]";
};
}//else{
//p("call default isArray()" + Array.isArray(a))
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment