Skip to content

Instantly share code, notes, and snippets.

@SeanChristopherConway
Created February 16, 2018 07:55
Show Gist options
  • Save SeanChristopherConway/8e362a852c7c476f23435907d1d6e64d to your computer and use it in GitHub Desktop.
Save SeanChristopherConway/8e362a852c7c476f23435907d1d6e64d to your computer and use it in GitHub Desktop.
Best way to get a javascript variable type
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