Skip to content

Instantly share code, notes, and snippets.

@mnirm
Created March 21, 2019 00:20
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 mnirm/6209c95f50975d0d9e5c8bf43c52051b to your computer and use it in GitHub Desktop.
Save mnirm/6209c95f50975d0d9e5c8bf43c52051b to your computer and use it in GitHub Desktop.
get type from an object back as string
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