How do you check if a value is an object in JavaScript?
Object.prototype.toString.call(myVar) will return:
Object.prototype.toString.call(myVar)
"[object Object]"
"[object Array]"
For more information on this and why it is a good alternative to typeof, check out this article.