includes vs some for simple values

Benchmark created on


Description

JS .includes() vs .some()

Setup

const mill = 100000000;
const goal = mill - 50;

const list = Array(mill).fill(0).map((_, i) => i);
const func = i => i === goal;

Test runner

Ready to run.

Testing in
TestOps/sec
includes()
list.includes(goal)
ready
some()
list.some(func)
ready

Revisions

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