+ 1
How to make the method "Math.Random" return an integer?/Как сделать чтобы метод "Math.Random" возвращал целое число?
--
3 Respostas
+ 2
Math.floor((Math.random() * 10) + 1);
That code will give you a random int between 1 and 10
If you want to start from 0 remove the + 1
If you want greater or less than 10 replace 10
+ 2
Thanks)
0
Welcome :)