Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Chrome 125
Windows
Desktop
7 months ago
Test name Executions per second
toString 93901976.0 Ops/sec
template literal 109555760.0 Ops/sec
string literal concat 97529408.0 Ops/sec
String() 10429526.0 Ops/sec
Script Preparation code:
AخA
 
const i = 12345678
Tests:
  • toString

     
    i.toString()
  • template literal

     
    `${i}`
  • string literal concat

     
    "" + i;
  • String()

     
    String(i)