Array indexOf vs Set has method (v5)

Revision 5 of this benchmark created on


Preparation HTML

<script>
const arr = Array.from({length: 10000}, (x, i) => ++i)
const set = new Set([...arr])
</script>

Teardown

 

Test runner

Ready to run.

Testing in
TestOps/sec
Array indexOf
arr.indexOf(7450)
ready
Set has
set.has(7450)
ready
Array includes
arr.includes(7450)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.