is-empty-object
isEmptyObject(obj)
Used to determine if an object is an empty object (an object with no enumerable properties) such as {}
.
var isEmptyObject = require("can-util/js/is-empty-object/is-empty-object");
console.log(isEmptyObject({})); // -> true
console.log(isEmptyObject({ a: 1 })); // -> false
var obj = {};
Object.defineProperty(obj, "foo", {
enumerable: false,
value: "bar"
});
console.log(isEmptyObject(obj)); // -> true
Parameters
- obj
{Object}
:Any object.
Returns
{Boolean}
:
True if the object is an object with no enumerable properties.