JSFiddle - React, Tailwind, and code Playground
JavaScript
var test2 = [{},{}] ;
var test3 = [{"a":1},{},{}] ; //All these are not empty
var test4 = [{},{"a":1},{}] ; //All these are not empty
var test5 = [{},{},{"a":1}] ; //All these are not empty
function isArrayEmpty(array) {
return array.filter(function(el) {
return !jQuery.isEmptyObject(el);
}).length === 0;
}
console.log(isArrayEmpty(test2));
console.log(isArrayEmpty(test3));
console.log(isArrayEmpty(test4));
console.log(isArrayEmpty(test5));