I would like to randomly select one element from an array, but each element has a known probability of selection.
All chances together (within the array) sums to 1.<
"Wheel of Fortune" O(n), use for small arrays only:
function pickRandomWeighted(array, weights) { var sum = 0; for (var i=0; i