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