Last active
April 11, 2018 07:24
-
-
Save iwill/59445262f60ead402be9515730f5b292 to your computer and use it in GitHub Desktop.
typeOf
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
/*! | |
* Javascript library - $class v0.2 | |
* http://github.com/iwill/ | |
*/ | |
/** | |
* typeOf with Object.prototype.toString + instanceof | |
* #see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString#Description | |
*/ | |
function typeOf(obj) { | |
return Object.prototype.toString.call(obj).slice(8, - 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment