Answers for "is this an object in javascript"

4

is object js

//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 "is this an object in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language