I have seen many places using Math.floor() and Math.random()
like below
$(\'a.random-color\').hover(function() { //mouseove
~~Number is only the Math.floor() for positive numbers. For negative numbers, it is the Math.ceil().
For positive numbers you can use:
Math.floor(x) == ~~(x)
Math.round(x) == ~~(x + 0.5)
Math.ceil(x) == ~~(x + 1)
For negative numbers you can use:
Math.ceil(x) == ~~(x)
Math.round(x) == ~~(x - 0.5)
Math.floor(x) == ~~(x - 1)