js math floor math random code example
Example 1: math random js
function getRandomIntInclusive(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min; // max & min both included
}
Example 2: math.random js
Math.floor(math.random() * 10);