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