Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
String in array
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
includes
52.1M/s
indexOf
47.4M/s
View exact numbers
Test name
Executions per second
✓
includes
52,098,864 Ops/sec
indexOf
47,429,076 Ops/sec
Script Preparation code:
const str = "2"; const arr = "1234".split('');
Tests:
indexOf
"1234".split('').indexOf('4') === -1
includes
"1234".split('').includes('2')