Skip to content

Instantly share code, notes, and snippets.

@jhonsore
Created January 26, 2016 13:40
Show Gist options
  • Save jhonsore/226abac3d974c0118963 to your computer and use it in GitHub Desktop.
Save jhonsore/226abac3d974c0118963 to your computer and use it in GitHub Desktop.
Returns variable type in js
var types = {
'get': function(prop) {
return Object.prototype.toString.call(prop);
},
'object': '[object Object]',
'array': '[object Array]',
'string': '[object String]',
'boolean': '[object Boolean]',
'number': '[object Number]'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment