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