Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
IndexOf vs Includes vs lodash includes for string
Banana
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Includes
2508.9M/s
IndexOf
2428.4M/s
lodash
37.4M/s
View exact numbers
Test name
Executions per second
✓
Includes
2,508,865,280 Ops/sec
IndexOf
2,428,409,088 Ops/sec
lodash
37,406,412 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
var array = 'bananasausagejesus'
Tests:
IndexOf
array.indexOf('sausage') !== -1
Includes
array.includes('sausage')
lodash
_.includes(array, 'sausage')