Array.includes vs Set.has

Benchmark created on


Setup

const arr = [1,2,3,4,5,6];
const set = new Set([1,2,3,4,5,6]);

Test runner

Ready to run.

Testing in
TestOps/sec
includes
arr.includes(6);
ready
has
set.has(6);
ready

Revisions

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