If you want to generate the random numbers from a given range, follow the steps for that :
Check the following example :
- First you will have to get the number between 0 and 10 from random() method.
- After that you will have to multiply that number with the difference of upper value and one less than the lower value of the range.
- For converting that into an integer. you will have to use floor().
- Lastly add the lower value of the range.
The code above generates a random number between 10 and 20.
var rand_no = Math.floor((20-9)*Math.random()) + 10;
IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people....