array length null undefined or length 0 code example
Example: javascript not empty array not string
if (Array.isArray(array) && array.length) {
// array exists and is not empty
}
if (Array.isArray(array) && array.length) {
// array exists and is not empty
}