Answers for "js check object is 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

Code answers related to "Javascript"

Browse Popular Code Answers by Language