Array.push vs index (v2)

Revision 2 of this benchmark created on


Setup

const arr = []

Test runner

Ready to run.

Testing in
TestOps/sec
Index
for (var i = 0; i < 10; i++) {
   arr[i] = i
}


ready
Array.prototype.push()
for (var i = 0; i < 10; i++) {
   arr.push(i)
}


ready

Revisions

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