Created
January 26, 2016 13:40
-
-
Save jhonsore/226abac3d974c0118963 to your computer and use it in GitHub Desktop.
Returns variable type in js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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