Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0
Firefox 135
Windows
Desktop
26 days ago
Test name Executions per second
Array.reverse() 69733.0 Ops/sec
Array.toReversed() 20347.7 Ops/sec
Script Preparation code:
AخA
 
array = Array.from({length: 10000}).map((_, i) => { number: i })
Tests:
  • Array.reverse()

     
    array.reverse();
  • Array.toReversed()

     
    array.toReversed();