Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
get first element
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
for...loop
165.4M/s
[0]
147.9M/s
find
146.9M/s
View exact numbers
Test name
Executions per second
✓
for...loop
165,431,088 Ops/sec
[0]
147,856,848 Ops/sec
find
146,944,256 Ops/sec
Tests:
[0]
const a = [1,2,3,4,5,6,6,7]; a[0]
for...loop
const a = [1,2,3,4,5,6,6,7]; for (let i = 0; i < a.length; i++) { const el = a[i] if (el != null) { return el } }
find
const a = [1,2,3,4,5,6,6,7] a.find(e => e!= null)