Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119
Mac OS X 10.15.7
Desktop
11 months ago
Test name Executions per second
trunc 9089574.0 Ops/sec
round 9058531.0 Ops/sec
floor 9045109.0 Ops/sec
parseFloat to int 3610827.8 Ops/sec
~~ 1033449856.0 Ops/sec
0 | 1030017792.0 Ops/sec
parseInt 8951245.0 Ops/sec
parseInt, 10 8911959.0 Ops/sec
Tests:
  • trunc

  • round

  • floor

  • parseFloat to int

  • ~~

  • 0 |

  • parseInt

  • parseInt, 10