Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
Chrome 115
Windows
Desktop
one year ago
Test name Executions per second
array 17330082.0 Ops/sec
set 15236870.0 Ops/sec
Script Preparation code:
AخA
 
var a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var b = new Set(a)
Tests:
  • array

     
    for (const x of a) {}
  • set

     
    for (const x of b) {}