+ 2
Random Numbers in JavaScript
What is the best way to get specific random numbers?
7 Answers
+ 7
Random number between 0.0 and 1.0:
Math.random()
Random number between 1 and n:
Math.floor(Math.random() * n) + 1
Random number between min and max:
Math.floor(Math.random() * (max - min + 1) + min)
+ 2
JavaScript
+ 2
Well, you could try the Math.random method. If that helps
+ 1
In what language?
0
Iâm trying to get random numbers in between 1 and 3 with no decimals
0
Thanks
0
I already know that method