var x= Math.random( );
- In the above example we have shown that how random number is been used in the program.
- We have generated a random number by using Math.random( ) object in the program.
- var x= Math.random(); is used for generating a random number.
- Save the file as generaterandomnumber_example.html in your system.
- Just open the file in the browser, you will see the below picture in the browser.
When the execution process is completed successfully we will get the following output: