Math Functions in js

Math Functions:-

Math.random()
Math.ceil()

Math.random():-

The Math.random() function returns a random number (float value) in range 0 to less than 1 (
0 <= randomNumber < 1).

js:- console.log(Math.random());

o/p:- 0.11652336903332472

         0.25413548754002384.....etc

we will get different output every time we will run the code.



Math.ceil():-

The Math.ceil() function always rounds a number up to the next largest integer.

js:-console.log(Math.ceil(95.906698007537561));  

o/p:-  96

Comments