Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
Chrome 59
Windows
Other
7 years ago
Test name Executions per second
for..in 58672.5 Ops/sec
foreach 453929.5 Ops/sec
some 2768497.0 Ops/sec
for 48671.3 Ops/sec
for with predefined size 83219.1 Ops/sec
while 1386640.1 Ops/sec
every 5305838.0 Ops/sec
Script Preparation code:
Tests:
  • for..in

  • foreach

  • some

  • for

  • for with predefined size

  • while

  • every