If you want to round a number downward in JavaScript, don't use `Math.floor()`

, `~~`

is faster.

Consider we have a `pi`

variable that equals to `3.14`

and we want to round it downward. So we can do:

`var rounded = ~~pi; //result: 3`

Instead of

`var rounded = Math.floor(pi); //result: 3`

Online benchmark: http://jsperf.com/math-round-vs

True, but it clamps to 32 bit integer, so careful with big numbers ;)