Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
findIndex vs indexOf vs contains
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
Browser:
Firefox 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
indexOf
1030.3M/s
startWith
1016.4M/s
includes
977.7M/s
View exact numbers
Test name
Executions per second
✓
indexOf
1,030,295,360 Ops/sec
startWith
1,016,395,200 Ops/sec
includes
977,669,120 Ops/sec
Script Preparation code:
var arr = '+12321313eefs,dmfsmfksf'
Tests:
startWith
var index = arr.startsWith('+');
indexOf
var index = arr.indexOf('+');
includes
var index = arr.includes('+');