Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.indexOf vs Array.includes vs lodash includes with numerical values
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Browser:
Firefox 115
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array.indexOf
22137300.0 Ops/sec
Array.includes
30995666.0 Ops/sec
lodash includes
8331431.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 = [1, 10, 5, 6, 2, 4, 3, 8, 7, 9]
Tests:
Array.indexOf
array.indexOf(3) !== -1
Array.includes
array.includes(3)
lodash includes
_.includes(array, 3)