Array indexOf vs Set has method (v4)

Revision 4 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

Revisions

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