how to make a empty javascript object code example
Example 1: javascript check if object is empty
function isObjectEmpty(obj) {
return Object.keys(obj).length === 0;
}
Example 2: declare empty object javascript
var objectA = {} //This is an object literal // NB: Preferred Way
var objectB = new Object() //This is the object constructor