Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.at(i) vs Array[i]
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0
Browser:
Firefox 139
Operating system:
Linux
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
Array.at(i)
30875.5 Ops/sec
Array[i]
31155.9 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const array = []; const indexes = []; const l = 999999; const iterations = 9999; for (let i = 0; i < length; ++i) { array.push(Math.random()); } for (let i = 0; i < iterations; ++i) { indexes.push(Math.floor(Math.random() * l)); }
Tests:
Array.at(i)
let total = 0; for(let i = 0; i < iterations; ++i) { const index = indexes[i]; total += array.at(index); } console.log(total);
Array[i]
let total = 0; for(let i = 0; i < iterations; ++i) { const index = indexes[i]; total += array[index]; } console.log(total);