Clear array

Benchmark created on


Setup

const arr = new Array(100).fill(1);

Test runner

Ready to run.

Testing in
TestOps/sec
length
arr.length = 0;
ready
splice
arr.splice(0, arr.length);
ready
pop
while(arr.length > 0) {
    arr.pop();
}
ready

Revisions

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