Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119
Windows
Desktop
one year ago
Test name Executions per second
String() 38276.6 Ops/sec
.toString() 497023.1 Ops/sec
template string 1232863.6 Ops/sec
add to string 899193.2 Ops/sec
Number to Number via + 13736742.0 Ops/sec
String to Number via + 6060011.5 Ops/sec
String to Number via parseInt 92866.9 Ops/sec
Tests:
  • String()

  • .toString()

  • template string

  • add to string

  • Number to Number via +

  • String to Number via +

  • String to Number via parseInt