Answers for "math floorjavascript"

40

math.floor js

console.log(Math.floor(5.95));
// expected output: 5

console.log(Math.floor(5.05));
// expected output: 5

console.log(Math.floor(5));
// expected output: 5

console.log(Math.floor(-5.05));
// expected output: -6
Posted by: Guest on April-06-2020
0

js floor a number

console.log(Math.floor(1.5)); // -> 1
console.log(~~1.5); // -> 1
Posted by: Guest on March-28-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language