I would like to know how to check if an array is empty or null in jQuery. I tried array.length === 0 but it didn\'t work. It did not throw any error either.
I think it is dangerous to use $.isEmptyObject from jquery to check whether the array is empty, as @jesenko mentioned. I just met that problem.
In the isEmptyObject doc, it mentions:
The argument should always be a plain JavaScript Object
which you can determine by $.isPlainObject. The return of $.isPlainObject([]) is false.