how to empty a list in javascript code example
Example 1: js delete all array items
A.splice(0,A.length)
Example 2: javascript declare empty array
// Variable array for a wider scope:
var arrayName = [];
// Local scope variable array:
let arrayName = [];