Q:

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
16
Input  : Math.floor(4.23)
Output : 4

Input  : Math.floor(0.8)
Output : 0
2
console.log(Math.floor(5.05));
// expected output: 5
1

New to Communities?

Join the community