has vs includes with big array

Benchmark created on


Setup

const bigArr = Array.from(new Array(1_000_000), (_, i) => i)

const set = new Set(bigArr)

Test runner

Ready to run.

Testing in
TestOps/sec
Set has
const x = set.has(757_575)
ready
Include
const x = bigArr.includes(757_575)
ready

Revisions

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