Or if you’re bent on really emptying it—especially while doing something with the elements as you’re stripping them out—you could do something like this–
var array = [ 'one', 'two', 'three' ];
while ( array.length > 0 ) { array.shift(); }
[close]
Permanent link · http://querylog.com/q/clear+an+array+javascript