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 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 132
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
IndexOf
72100096.0 Ops/sec
Includes
76355080.0 Ops/sec
lodash
49683728.0 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')