Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15
Safari 13
Mac OS X 10.15.3
Desktop
4 years ago
Test name Executions per second
for 27332472.0 Ops/sec
for of 21128240.0 Ops/sec
for in 3902593.5 Ops/sec
forEach 20965968.0 Ops/sec
for 2 28488180.0 Ops/sec
while with shift 1532721.5 Ops/sec
while 27553512.0 Ops/sec
while with length reduction 27727566.0 Ops/sec
for reverse 15509858.0 Ops/sec
Tests:
  • for

  • for of

  • for in

  • forEach

  • for 2

  • while with shift

  • while

  • while with length reduction

  • for reverse