Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Check for equal value at given index
Testing the difference between native loops and find()
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
for-loop
13837749.0 Ops/sec
Array.find()
96447920.0 Ops/sec
HTML Preparation code:
<div id='test'></div>
Tests:
for-loop
var arr = ['hello', 'a', 'b']; var arr2 = ['c', 'a', 'z']; let val; for(i=0; i<arr.length; i++){ if (arr2[i] === arr[i]) { val = arr[i]; break; } }
Array.find()
var arr = ['hello', 'a', 'b']; var arr2 = ['c', 'a', 'z']; let val = arr.find((node, i) => node === arr2[i]);