JavaScript(JS) math method - random

The random method in JavaScript's Math object returns a random number between 0 (inclusive) and 1 (exclusive). The random method does not take any arguments.

Here's an example usage:

refer t‮o‬:theitroad.com
const randomNum = Math.random();
console.log(randomNum); // 0.123456789 (a random number between 0 and 1)

In the above example, the Math.random method is used to generate a random number between 0 and 1. The result is then logged to the console. Note that the actual random number generated will be different every time the code is run.