Skip to content

Instantly share code, notes, and snippets.

@xyqfer
Created September 28, 2013 07:22
Show Gist options
  • Select an option

  • Save xyqfer/6739486 to your computer and use it in GitHub Desktop.

Select an option

Save xyqfer/6739486 to your computer and use it in GitHub Desktop.
对象类型检测
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