That ~~
is a double NOT bitwise operator.
It is used as a faster substitute for Math.floor() for positive numbers. It does not return the same result as Math.floor()
for negative numbers, as it just chops off the part after the decimal (see other answers for examples of this).