look up in array

Benchmark publishedon

Setup

var arr = []
for (let i = 0; i < 100; i++) arr.push(i)

var numberToFind = () => Math.floor(Math.random() * 100)

Test Runner

Initializing...

Testing in
Test CaseOps/sec
includes
arr.includes(numberToFind())

ready
set
new Set(arr).has(numberToFind())
ready

Revisions

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

Revision 1
publishedon