Generate Random Integers
> Math.random();
0.4663311937101857function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
> getRandomInt(10);
1
> getRandomInt(10);
7
> getRandomInt(10);
2Last updated
> Math.random();
0.4663311937101857function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
> getRandomInt(10);
1
> getRandomInt(10);
7
> getRandomInt(10);
2Last updated