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