check if js object is empty
function isObjectEmpty(obj) {
return Object.keys(obj).length === 0;
}// because Object.entries(new Date()).length === 0;
// we have to do some additional check
Object.entries(obj).length === 0 && obj.constructor === Objectfunction isEmpty(obj) { return Object.keys(obj).length === 0;}// because Object.keys(new Date()).length === 0;
// we have to do some additional check
Object.keys(obj).length === 0 && obj.constructor === ObjectJSON.stringify({}) !== '{}';
Also in JavaScript:
- back press subscriptions i is not a function react native
- replacing characters in string javascript
- angular get current time
- how to do radio button validation in jquery
- react how to create range
- getrect javascript
- live background react
- nodejs add to array
- mac os chrome opne debug new tab
- how to deploy node-red as a window service
- js go back
- javascript data em portugues
- how to draw flower petals around circle javascript
- jquery get request
- convert shp to geojson python
- how to pass a value to a react funtion without immediately firing it
- facebook integration in node.js
- convert to float in javascript
- javascript 1 + "1"
- javascript date difference in months
- showing file download progress in angular
- password validation with regular expression in javascript
- node js find directory change directory
- node js if no arguments