Checks if the passed value is an object or not.
Object
constructor to create an object wrapper for the given value.null
or undefined
, create and return an empty object.const isObject = obj => obj === Object(obj);
isObject([1, 2, 3, 4]); // true
isObject([]); // true
isObject(['Hello!']); // true
isObject({ a: 1 }); // true
isObject({}); // true
isObject(true); // false
JavaScript, Type
Checks if a value is object-like.
JavaScript, Type
Checks if the a value is an empty object/collection, has no enumerable properties or is any type that is not considered a collection.
JavaScript, Type
Checks if an object looks like a Promise
.