what does the array return when the element is empty code example
Example 1: javascript is array empty
var colors=[];
if(!colors.length){
// I am empty
}else{
// I am not empty
}
Example 2: how to make array empty
A.length = 0
var colors=[];
if(!colors.length){
// I am empty
}else{
// I am not empty
}
A.length = 0