Set.has vs Array.includes

Benchmark created on


Setup

const size = 250
const myArray = Array.from({length: size}).map((_, i) => i)

const mySet = new Set(myArray)


Test runner

Ready to run.

Testing in
TestOps/sec
Array includes
myArray.includes(55)
ready
Set has
mySet.has(55)
ready

Revisions

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