Test case details

Preparation Code

var a = []; for (var i = 1; i < 100000; i++) { a.push(i); }
var a = []; for (var i = 1; i < 100000; i++) { a.push(i); }

Test cases

Test #1

while(a.length) { a.pop(); }

Test #2

while(a.pop()) {}

Test #3

while(a.pop() !== undefined) {}

Test #4

var len = a.length; while(len--) a.pop();

Test #5

a = [];

Test #6

a.length = 0;

Test #7

a.splice(0)