Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4243.0 Safari/537.36
Chrome 87
Windows
Desktop
4 years ago
Test name Executions per second
for 661.3 Ops/sec
for (less closure) 684.6 Ops/sec
for of 3898.0 Ops/sec
for of (less closure) 3985.0 Ops/sec
forEach 1598.4 Ops/sec
forEach (less closure) 1483.4 Ops/sec
reduce 1543.0 Ops/sec
reduce (less closure) 1499.1 Ops/sec
Script Preparation code:
Tests:
  • for

  • for (less closure)

  • for of

  • for of (less closure)

  • forEach

  • forEach (less closure)

  • reduce

  • reduce (less closure)


;