Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
for vs for of
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Browser:
Firefox 122
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
for
890.0 Ops/sec
for of
171.5 Ops/sec
Script Preparation code:
var count = 1000 * 1000 var data = []; do { data.push(count); } while(--count);
Tests:
for
var length = data.length; for (var index = 0; index < length; index++) { var obj = data[index]; obj == obj; }
for of
for (var obj of data) { obj == obj; }