how to heck for empty list in javascript code example
Example 1: javascript check if array is empty
if (array && !array.length) {
// array is defined but has no element
}
Example 2: array==null array.length java script
if (typeof array != "undefined" && array != null && array.length != null && array.length > 0) {
// array exists and is not empty
}