Run details:
Mozilla/5.0 (Linux; Android 13; 22041216G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Mobile Safari/537.36
Chrome Mobile 110
Android
Mobile
2 years ago
Test name Executions per second
sort 4861.2 Ops/sec
reduce 43077.3 Ops/sec
Script Preparation code:
AخA
 
var a=Array.from({length:10000},()=>Math.floor(Math.random() * 10001))
Tests:
  • sort

     
    a.sort()[0];
  • reduce

     
    a.reduce((a,c) => a < c ? a : c)