Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome 87
Windows
Desktop
3 years ago
Test name Executions per second
for loop 948124.1 Ops/sec
Array.prototype.reduce.call 298208.6 Ops/sec
String.prototype.reduce 269954.4 Ops/sec
Array.prototype.forEach 271579.4 Ops/sec
.split.reduce 769837.9 Ops/sec
.split.forEach 678940.8 Ops/sec
Script Preparation code:
Tests:
  • for loop

  • Array.prototype.reduce.call

  • String.prototype.reduce

  • Array.prototype.forEach

  • .split.reduce

  • .split.forEach