Emptying an array (v26)

Revision 26 of this benchmark created by rajat on


Setup

var arr = ['apples', 'pears', 'oranges', 'lemons', 'kiwis', 'bananas', 'strawberries', 'grapefruits', 'pineapples', 'satsumas', 'lychees'];
  while(arr.length > 0) {
      arr.pop();
  }

Test runner

Ready to run.

Testing in
TestOps/sec
arr pop
while(arr.length > 0) {
    arr.pop();
}
ready
Creating a new empty array
arr = [];
ready

Revisions

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