Run details:
Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36
Chrome 88
Windows 8.1
Desktop
3 years ago
Test name Executions per second
parseInt a number 274343.7 Ops/sec
parseInt a string 263973.0 Ops/sec
toString a number 3086143.8 Ops/sec
toString a string 3801974.2 Ops/sec
unery convert to number from number 5393424.5 Ops/sec
unery convert to number from string 2044755.2 Ops/sec
Script Preparation code:
Tests:
  • parseInt a number

  • parseInt a string

  • toString a number

  • toString a string

  • unery convert to number from number

  • unery convert to number from string