Emptying an array (v20)

Revision 20 of this benchmark created by Sergio on


Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
Setting .length to 0
arr.length = 0;
ready
Creating a new empty array
arr = [];
ready
Creating a new empty array without possible memory leaks
arr = null; arr = [];
ready

Revisions

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