Answers for "javascript variable is "[object object]""

4

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
Posted by: Guest on July-24-2019
0

javascript is object

typeof yourVariable === 'object' && yourVariable !== null
Posted by: Guest on January-18-2021

Code answers related to "javascript variable is "[object object]""

Code answers related to "Javascript"

Browse Popular Code Answers by Language