javascript check empty object
function isObjectEmpty(obj) {
return Object.keys(obj).length === 0;
}function isEmptyObject(obj) {
return !Object.keys(obj).length;
}// because Object.entries(new Date()).length === 0;
// we have to do some additional check
Object.entries(obj).length === 0 && obj.constructor === ObjectObject.entries(objectToCheck).length === 0
Also in JavaScript:
- mm dd yyyy how to get date in this format in javascript
- get current scroll height javascript
- javascript get width of image
- explain js es6
- adonis andwhere
- Robux gift
- Rectangle class module
- how to remove property of object in javascript without delete
- nodejs print
- how to convert a number to a string in javascript
- how to trigger an event on reload js
- js random string
- javascript get dictionary values
- javascript index of biggest number
- angular in memory web api login curd exmpal
- javascript clear style inline property
- jquery loop through list element
- creating react app using npx
- les fonctions reguliere javascript
- regex only uppercase letters js
- get current month of year in number javascript
- how sent data to dilaog angular material
- what are the two ways to create an array in javascript examples?
- post express node js input