Possible Duplicate:
Generating random numbers in Javascript in a specific range?
Say I wanted to generate a random number from 50 to 100.
I know there's:
Math.random()
but I could only find ways to go from 1 to 'x'
Possible Duplicate:
Generating random numbers in Javascript in a specific range?
Say I wanted to generate a random number from 50 to 100.
I know there's:
Math.random()
but I could only find ways to go from 1 to 'x'
I believe this would also work:
In your case min would be 50 and range would be 50
From MDN on
Math.random()
: