check or array is empty code example
Example 1: javascript check if array is not empty
if (array === undefined || array.length == 0) {
// array empty or does not exist
}
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
}