Created
September 28, 2013 07:22
-
-
Save xyqfer/6739486 to your computer and use it in GitHub Desktop.
对象类型检测
This file contains hidden or 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
| var toType = function(obj) { | |
| return Object.prototype.toString.call(o).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment