DEV Community

Vasudevan Tamilarasan
Vasudevan Tamilarasan

Posted on

JS Methods

Payilagam: 10-Mar-2025

Topic: Javascript methods

Math.random()

It generate a random float number from 0 to 1. (eg: 0.90055, 0.534434)
Enter fullscreen mode Exit fullscreen mode

Math.round()

It rounds the float number into the whole number.
Enter fullscreen mode Exit fullscreen mode

Math.floor()

It also round the float number to its lowest value.(eg: .0980 -> 1)
Enter fullscreen mode Exit fullscreen mode

Math.ceil()

It also round the float number to its highest values. (eg: 9.43 -> 10)
Enter fullscreen mode Exit fullscreen mode

SetTimeout(any_function, timeout_limit_in_sec)

It performs the function, after the mentioned the time limit crossed. 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)