clean up empty arrays js code example
Example 1: empty array javascript
let myArray = [12 , 222 , 1000 ];
myArray.length = 0; // myArray will be equal to [].
Example 2: empty array javascript
// set array
arr = [1,2,4];
// empty array
arr = [];