Emptying an array (v9)

Revision 9 of this benchmark created on


Setup

var arr = ['apples', 'pears', 'oranges', 'lemons', 'kiwis', 'bananas', 'strawberries', 'grapefruits', 'pineapples', 'satsumas', 'lychees'];

Test runner

Ready to run.

Testing in
TestOps/sec
Splice array
arr.splice(0, arr.length);
ready
Clear array
var len = arr.length;
for (var x = 0; x < len; x++) {
  arr.pop(x);
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.