Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
find vs findIndex vs filter with value
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 14; Mobile; rv:136.0) Gecko/136.0 Firefox/136.0
Browser:
Firefox Mobile 136
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Array.prototype.findIndex
221K/s
Array.prototype.find
221K/s
Array.prototype.filter
207K/s
View exact numbers
Test name
Executions per second
✓
Array.prototype.findIndex
221,226 Ops/sec
Array.prototype.find
220,538 Ops/sec
Array.prototype.filter
207,423 Ops/sec
Script Preparation code:
var arr = []; var i = 0; while (i <= 1E3) arr[i] = i++;
Tests:
Array.prototype.find
const item = arr.find(item => item == 1E3);
Array.prototype.findIndex
const index = arr.findIndex(item => item == 1E3); const item = arr[index]
Array.prototype.filter
const item = arr.filter(item => item == 1E3)[0];