~~, bitwise << and Math.trunc. Math.floor will always round down to the nearest integer, which means that for negative numbers it's going to be one less than all the other ones. You shouldn't use the others for rounding down for the same reason - the answer will be wrong for negative numbers.
Comparing performance of: Bitwise vs ~~ vs Math.trunc
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
Bitwise
~~
Math.trunc
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36