Last active
December 21, 2015 05:49
-
-
Save jation/6260255 to your computer and use it in GitHub Desktop.
兼容ES3和ES5的Array.isArray()方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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