node js check array is empty code example
Example 1: js how to check is array empty es6
var colors=[];
if(!colors.length){
// I am empty
}else{
// I am not empty
}
Example 2: empty array length javascript
empty array check javascript
var colors=[];
if(!colors.length){
// I am empty
}else{
// I am not empty
}
empty array check javascript