javascript how to ceil number 1

javascript how to ceil number

Math.ceil(4.23) => 5
Math.ceil(7.05) => 8

Here is what the above code is Doing:
1. We’re creating a function called “ceil” that takes in a number as a parameter.
2. We’re creating a variable called “rounded” that is equal to the number rounded up to the nearest integer.
3. We’re returning the variable “rounded”.

Similar Posts