When I was developing my own HTML5 game engine, I needed to focus on performance to have the fastest processing of frames to draw. On of the most used methods within the drawing loop was rounding the pixel coordinates to avoid half pixel coordinates.
This method uses double-not bitwise operator ~~ to round the number 9.5.
r = ~~9.5;
Another option is to use the bitwise or operator | not to confuse with the logical or which we use in our if statements.
r = 9.5|0
The third option is to use the Cached Math.Floor() function
r = f(9.5)
These three functions turned our to show different on performance when ran at jsperf.com
As one can see the bitwise OR operator turned out to be the fastest. In daily use we could argue Math.floor() is sufficient and more readable. For the HTML5 game engine, which does a lot of floor operations every second, this is a performance gain.