random numbergenerator javascript code example
Example 1: how to create a random number generator in javascript
console.log(Math.floor(Math.random() * 10))
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);