Push item inside an array (v6)

Revision 6 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
arr.push
arr.push(8);
ready
arr[arr.length]
arr[arr.length] = 8;
ready
arr.concat
arr.concat([8]);
ready
arr.splice
arr.splice(arr.length, 0, 8);
ready

Revisions

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