Math.ceil()
ES1+Returns the smallest integer greater than or equal to a given number.
Syntax
Math.ceil(x)Parameters
x number A number
Return Value
number
The smallest integer greater than or equal to the given number
Examples
JavaScript
console.log(Math.ceil(4.2));
console.log(Math.ceil(4.7));
console.log(Math.ceil(-4.7)); Output:
// 5
5
-4