Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Mac OS X 10.15.7
Desktop
10 months ago
Test name Executions per second
trunc 8609171.0 Ops/sec
round 8677476.0 Ops/sec
floor 8583646.0 Ops/sec
parseFloat to int 3347521.2 Ops/sec
~~ 180458304.0 Ops/sec
0 | 174765968.0 Ops/sec
parseInt 8471238.0 Ops/sec
parseInt, 10 8565744.0 Ops/sec
Tests:
  • trunc

  • round

  • floor

  • parseFloat to int

  • ~~

  • 0 |

  • parseInt

  • parseInt, 10