ixfx
    Preparing search index...

    Function weightedIndex

    • Returns a random number from 0..weightings.length, distributed by the weighting values.

      eg: produces 0 20% of the time, 1 50% of the time, 2 30% of the time

      weightedIndex([0.2, 0.5, 0.3]);
      

      Parameters

      Returns () => number