Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
IndexOf boolean vs Includes on string
if 50 elements array contains some word
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/142.0.0.0 Safari/537.36 Edg/142.0.0.0
Browser:
Chrome 142
Operating system:
Windows
Device Platform:
Desktop
Date tested:
9 months ago
Benchmark engine:
Benchmark.js
Includes
166.3M/s
IndexOf
162.7M/s
View exact numbers
Test name
Executions per second
✓
Includes
166,275,504 Ops/sec
IndexOf
162,670,368 Ops/sec
Script Preparation code:
var text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum"
Tests:
IndexOf
text.indexOf('printer') > -1
Includes
text.includes('printer')