Push vs .length

Benchmark created on


Description

A test to see how much faster arr.push() is vs arr[arr.length]

Setup

var arr = ["Hiya", "this", "is", "an", "array", "magical", "no?!"];

Test runner

Ready to run.

Testing in
TestOps/sec
Push
arr.push("Hiya");
arr.push("Testing");
ready
Length
arr[arr.length] = "Hiya";
arr[arr.length] = "Testing";
ready

Revisions

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