Array indexOf vs Set has method (v3)

Revision 3 of this benchmark created on


Preparation HTML

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

Teardown

 

Test runner

Ready to run.

Testing in
TestOps/sec
Array indexof
arr.indexOf(750)
ready
Set has
set.has(750)
ready

Revisions

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