declare an empty string array in javascript code example
Example 1: javascript not empty array not string
if (Array.isArray(array) && array.length) {
// array exists and is not empty
}
Example 2: javascript declare empty array
// Variable array for a wider scope:
var arrayName = [];
// Local scope variable array:
let arrayName = [];