Last active
December 12, 2018 23:00
-
-
Save kitsune7/1a60321140bf2f01609c4c8a8ceb8440 to your computer and use it in GitHub Desktop.
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
| /* | |
| * @param variable The variable you want to get the type of | |
| * @returns 'string', 'number', 'array', 'function', or 'object' | |
| */ | |
| function type (variable) { | |
| return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment