javascript cant return empty array code example
Example 1: javascript empty array
var colors = ["red","blue","green"];
colors = []; //empty the array
Example 2: javascript empty array
if (array === undefined || array.length == 0) {
// array empty or does not exist
}