create array empty in javascript code example
Example 1: javascript empty array
var colors = ["red","blue","green"];
colors = []; //empty the array
Example 2: create an empty array js
let arrayName = [];
var colors = ["red","blue","green"];
colors = []; //empty the array
let arrayName = [];