Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
array = [] vs array.length = 0
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 124
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
array = []
1660848.9 Ops/sec
array length = 0
1528402.6 Ops/sec
Script Preparation code:
var arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
Tests:
array = []
arr = [] arr.push(...['a', 'b', 'c']);
array length = 0
arr.length = 0; arr.push(...['a', 'b', 'c']);