math js random w3 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: random number in js
Math.random() returns a random number in [0,1)