Tutorial Empty an Array
by Unknown in javascript , Tutorial 0
This is one of the fastest and easiest ways of emptying an array. Of course there are may other ways, but those usually include creation of a new array. This way you reuse the same array.
var myArray = ["one", "two", "three"];
// console.log( myArray ) => ["one", "two", "three"]
myArray.length = 0;
// console.log( myArray ) => []