Created
January 14, 2014 04:06
-
-
Save linkgod/8412866 to your computer and use it in GitHub Desktop.
js类型判断
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
// type detect | |
utils.is = function(obj, type) { | |
return Object.prototype.toString.call(obj).slice(8, -1) === type; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment