I\'ve 3 entry inside an array
var prob = [0.3, 0.5, 0.2];
And I use the following code to get the "random with probability" value: