+ 2
How to use math . random to get a 2 digit value?
2 Respostas
+ 2
Well, what you could do is set the range from 10 to 99, just so that any value it will return will be a 2 digit number, then get the floor value of that so that it would be a whole number.
For example:
document.write(Math.floor(Math.random() * 99 + 1))
+ 1
thanks