array set length

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
set same length directly
[1, 2, 3].length = 3
ready
set same length with if guard
let a = [1, 2, 3]
if (a.length !== 3) {
	a.length = 3;
}
ready
set differ length directly
[1, 2, 3].length = 2
ready
set differ length with if guard
let a = [1, 2, 3]
if (a.length !== 2) {
	a.length = 2;
}
ready

Revisions

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