Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36
Chrome 101
Windows
Desktop
2 years ago
Test name Executions per second
spread 13613949.0 Ops/sec
for loop 1331241.4 Ops/sec
for loop (array push) 1214035.2 Ops/sec
slice 15440485.0 Ops/sec
Array.from 5305190.0 Ops/sec
Script Preparation code:
Tests:
  • spread

  • for loop

  • for loop (array push)

  • slice

  • Array.from