JS empty erray code example
Example 1: javascript empty array
var colors = ["red","blue","green"];
colors = []; //empty the array
Example 2: javascript is array empty
var colors=[];
if(!colors.length){
// I am empty
}else{
// I am not empty
}