push

Benchmark created on


Description

fun

Setup

let a = ["a","b","c"];

let b;

Test runner

Ready to run.

Testing in
TestOps/sec
push
for (let i = 0; i <= 100; i++){
	a.push(i);
}
ready
small
for (let i = 0; i <= 100; i++){
	b = [...a, i];
}
ready
other 1
for (let i = 0; i <= 100; i++){
	b = [...a];
}
ready
other 2
for (let i = 0; i <= 100; i++){
	b = (Array.isArray(a)) ? a : [a];
}
ready

Revisions

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