// Math.floor returns the floor of a number console.log(Math.floor(1.5)); // -> 1 // Using two bitwise not operators '~' you can also get the floor of a number console.log(~~1.5); // -> 1