Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Chrome 128
Windows
Desktop
one year ago
Benchmark.js
Set length to zero
36K/s
Just instantiate new array
35K/s
Splice
33K/s
Pop all values
20K/s
View exact numbers
Test name Executions per second
Set length to zero 36,054 Ops/sec
Just instantiate new array 34,983 Ops/sec
Splice 32,545 Ops/sec
Pop all values 19,538 Ops/sec
Tests: