Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/112.0
Firefox 112
Mac OS X 10.15
Desktop
2 years ago
Test name Executions per second
Sort without arguments 118012.6 Ops/sec
Sort with arguments 134609.9 Ops/sec
Script Preparation code:
AخA
 
var input = [];
for (var i = 0; i < 1000; i++) {
  input[i] = Math.round(Math.random() * 1000000);
}
Tests:
  • Sort without arguments

     
    return input.sort()
  • Sort with arguments

     
    return input.sort((a,b) => a-b)