Skip to content

Instantly share code, notes, and snippets.

@telekosmos
Created January 24, 2013 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save telekosmos/4619917 to your computer and use it in GitHub Desktop.
Save telekosmos/4619917 to your computer and use it in GitHub Desktop.
toType js function: returns the most accurate js type for a js object
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