Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134
Windows
Desktop
11 days ago
Test name Executions per second
array 16465939.0 Ops/sec
set 115048736.0 Ops/sec
Script Preparation code:
AخA
 
var a = [];
for(i=0;i<10000;i++) a.push(i);
var b = new Set(a)
Tests:
  • array

     
    a.indexOf(342);
  • set

     
    b.has(342);