javasript return empty array code example
Example 1: javascript empty array
var colors = ["red","blue","green"];
colors = []; //empty the array
Example 2: empty array javascript
let myArray = [12 , 222 , 1000 ];
myArray.length = 0; // myArray will be equal to [].