<script
src="https://code.jquery.com/jquery-3.6.4.min.js"
integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-min.js" integrity="sha512-2V49R8ndaagCOnwmj8QnbT1Gz/rie17UouD9Re5WxbzRVUGoftCu5IuqqtAM9+UC3fwfHCSJR1hkzNQh/2wdtg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
let obj={};
for(var i in obj) return false;
return true;
return JSON.stringify(obj) === '{}';
return Object.keys(obj).length === 0;
return Object.entries(obj).length === 0;
return Object.getOwnPropertyNames(obj).length === 0;
return Object.keys(obj).length === 0 && obj.constructor === Object;
return typeof obj === "undefined" || !Object.keys(obj)[0];
return Object.entries(obj).length === 0 && obj.constructor === Object;
return Object.values( obj ).every( val => typeof val === "undefined" );
for (const key in obj) {
if (hasOwnProperty.call(obj, key)) {
return false
}
}
return true;
for(var prop in obj) {
var isEmpty = true;
for (keys in obj) {
isEmpty = false;
break;
}
return isEmpty;
}
for(var prop in obj) {
if(obj.hasOwnProperty(prop))
return false;
}
return true;
for (var k in obj)
{
if (obj === null || typeof obj !== 'object' ||
Object.prototype.toString.call(obj) === '[object Array]') {
return false
} else {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
return false
}
}
return JSON.stringify(obj) === JSON.stringify({})
}
}
return Object.getOwnPropertyNames(obj).length === 0 &&
Object.getOwnPropertySymbols(obj).length === 0 &&
Object.getPrototypeOf(obj) === Object.prototype;
return !(Object.getOwnPropertyNames != undefined ? Object.getOwnPropertyNames(obj).length != 0 : (function(){for(var key in obj) break; return (key != null) && (key != undefined);})())
return $.isEmptyObject(obj);
return _.isEmpty(obj);