there's a question. I need to generate random numbers with ranges and each range has a fixed probability like this:
100 - 500 (75%)
501 - 5000 (20%)
10001 - 50000 (4%)
50001 - 100000 (1%)
I have no idea how should i do...
function getRandomAmount() {
const probabilities = [0.75, 0.2, 0.04, 0.01];
const items = []
// 100 - 5000 75%
// 5001 - 10000 20%
// 10001 - 50000 4%
// 50001 - 100000 1%
}