So, let's say I'm making something like a slots machine, to use the emojis I'd like to use I'd define them in an array.
var arr = ["emoji","emoji2","emoji3","emoji4","emoji5"]
Let's say I'd want emojis 1 - 4 to appear more than 5, and say decrease the probability of emoji5 being picked.
I could do something large like:
var arr = [
"emoji","emoji2","emoji3","emoji4",
"emoji","emoji2","emoji3","emoji4",
"emoji","emoji2","emoji3","emoji4",
"emoji","emoji2","emoji3","emoji4",
"emoji","emoji2","emoji3","emoji4",
"emoji","emoji2","emoji3","emoji4","emoji5",
]
var emoji = arr[Math.floor(Math.random() * arr.length)]
But that is not a very efficient idea, so is it possible to do the idea above without making a very large array?
What I'm aiming for basically is to have an array like
var arr = ["emoji","emoji2","emoji3","emoji4","emoji5"]
and it would output something where emojis 1 - 4 would appear way more often than emoji5, without a large array.