is object node js code example
Example 1: javascript is object
typeof yourVariable === 'object' && yourVariable !== null
Example 2: javascript check if variable is object
//checks if is object, null val returns false
function isObject(val) {
if (val === null) { return false;}
return ( (typeof val === 'function') || (typeof val === 'object') );
}
var person = {"name":"Boby Snark"};
isObject(person);//true