Script Preparation code:
x
 
var a = [];
var b = new Map()
for(let i = 0; i < 100000; i++){
  a.push(i);
  b.set(i, Math.random());
}
Tests:
  • includes

     
    return a.includes(Math.floor(Math.random()*100000))
  • lookup

     
    return b.has(Math.floor(Math.random()*100000))
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    includes
    lookup

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 16 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0
Firefox 137 on Windows
View result in a separate tab
Test name Executions per second
includes 21757.3 Ops/sec
lookup 2182811136.0 Ops/sec