I know that at first glance it sounds like a repeating question, but I don’t think it ...
I get a JSON array as:
var test1 = [] ;
or
var test2 = [{},{},{}] ;
I have no problem finding if test1 empty.
jQuery.isEmptyObject(test1)
My problem is with test2 ... Please note that in some cases test2 may return something like:
var test2 = [{"a":1},{},{}] ; //All these are not empty var test2 = [{},{"a":1},{}] ; //All these are not empty var test2 = [{},{},{"a":1}] ; //All these are not empty
The above scenarios should not be considered empty. I tried to use .length , but that does not help, since the length is always 3 ... Any ideas?
Greetings.
javascript jquery
Thanos
source share