Created
February 16, 2018 07:55
-
-
Save SeanChristopherConway/8e362a852c7c476f23435907d1d6e64d to your computer and use it in GitHub Desktop.
Best way to get a javascript variable type
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
Object.prototype.toString.call(myVar) will return: | |
"[object Object]" if myVar is an object | |
"[object Array]" if myVar is an array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment