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 9063010.0 Ops/sec
round 9093626.0 Ops/sec
floor 9079156.0 Ops/sec
parseFloat to int 3629580.0 Ops/sec
~~ 2097989888.0 Ops/sec
0 | 2099263104.0 Ops/sec
parseInt 9008950.0 Ops/sec
parseInt, 10 9032462.0 Ops/sec
Tests:
  • trunc

  • round

  • floor

  • parseFloat to int

  • ~~

  • 0 |

  • parseInt

  • parseInt, 10