Using concat as push

Benchmark created on


Description

This benchmark shows the performance of concat() when it is used as a substitue for push()

Test runner

Ready to run.

Testing in
TestOps/sec
Using concat()
let arr = []
for (let i = 0; i < 100; i++) {
	arr = arr.concat([i])
}
ready
Using push()
let arr = []
for (let i = 0; i < 100; i++) {
	arr.push(i)
}
ready

Revisions

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