Push item inside an array (v5)

Revision 5 of this benchmark created on


Description

Test different ways to add items to the end of an array

Setup

var arr = [1, 2, 3, 4, 5, 6, 7];

Test runner

Ready to run.

Testing in
TestOps/sec
Add element at the end of Array with push()
arr.push(8);
ready
Add element at the end of Array using the length property
arr[arr.length] = 8;
ready
Add element at the end of Array with concat()
arr.concat([8]);
ready

Revisions

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