Question
How do I use the .ceil()
method?
Answer
So like the other methods in the Math library, the format for methods would be like so: Math.methodName(possibleArgument)
, where methodName is whichever method you are using, ceil in this case, and possibleArgument is an argument that you can have if the method accepts an argument, ex: ceil accepts a number argument so you would give it a number, like 43.8, while random does not, so the parenthesis would be empty like so Math.random()
. Remember to print out the result by wrapping it around a console.log()
!