js check if not empty array code example
Example 1: javascript not empty array not string
if (Array.isArray(array) && array.length) {
// array exists and is not empty
}
Example 2: javascript how to check if array is empty
if(array.length > 0)