function isObject(o){
return !(o instanceof Array) && o instanceof Object
}
console.log(isObject([]));
console.log(isObject({}));
console.log(isObject('sss'));
console.log(isObject(undefined));
console.log(isObject(123));
console.log(isObject(null));
console.log(isObject(true)); |