Skip to content

Instantly share code, notes, and snippets.

@plutochill
Created September 25, 2013 03:30
Show Gist options
  • Save plutochill/6694862 to your computer and use it in GitHub Desktop.
Save plutochill/6694862 to your computer and use it in GitHub Desktop.
返回各种对象的类型
var toType = function(obj) {
return ({}).toString.call(obj).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