Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Linux
Desktop
one year ago
Test name Executions per second
Intl.NumberFormat 41968.3 Ops/sec
toLocalString 22594678.0 Ops/sec
Tests:
  • Intl.NumberFormat

    AخA
     
    var a = new Intl.NumberFormat("en-US").format("10000");
  • toLocalString

     
    var a = "10000".toLocaleString("en-US");