class aleatory html javascript code example
Example 1: get random numbers javascript
//Write the following code to get a random number between 0 and n
Math.floor(Math.random() * n);
Example 2: 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);