produce random numbers with more probabiltiy for one number javascript
Answers
Answered by
1
Hi,
function moreProbabiltiy() {
var moreProbabiltiyNumber = [1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4];
var index = Math.floor(Math.random() * moreProbabiltiyNumber.length);
return moreProbabiltiyNumber[index];
}
above function will increase the probability of numbers in array.
Similar questions
Computer Science,
7 months ago
Math,
7 months ago
Science,
1 year ago
Physics,
1 year ago
Science,
1 year ago