mat randont in js code example
Example 1: javascript random number generator
let replies = [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12"
];
let result = Math.floor(Math.random() * replies.length);
Example 2: 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
}