Last active
July 6, 2022 19:02
-
-
Save donbrae/ae8d1b734b370113948a6b0b89f19b79 to your computer and use it in GitHub Desktop.
Get type of object.
This file contains hidden or 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
// Source: https://github.com/cferdinandi/reef/commit/20e47e2b6e797e5201da1d8b2e7fb02504a25c6f#diff-26a6046c932328aabcf6b2db468298d6958105007730a04f6e1b942d7d916f07R43-R50 | |
function getType(obj) { | |
return Object.prototype.toString.call(obj).slice(8, -1).toLowerCase(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment