In this tutorial, you will learn about random() is as follows:
Shifting and Scaling
The range of the values produced directly by a random variable is often different from what is needed in a specific application.
Here, Math.random is multiplied with 6, so that we get a range from 0.0 6.0. This is called scaling.
Adding 1(here) to the obtained value is called shifting.
Math.floor() is used to determine the doset integer not greater than the argument value
Displaying Random Images
Web content that varies randomly can add dynamic, interesting effects to a page.
In Both methods has limited features in receiving input from the user
Script is often used to respond to user initiated events.