how to clear the array in js code example
Example 1: javascript array clear
var cars = ["mazda","honda","tesla"];
cars = []; // clear/empty the array
Example 2: how to clear array in javascript
A.length = 0
var cars = ["mazda","honda","tesla"];
cars = []; // clear/empty the array
A.length = 0