Function weightedRandom

  • return a weighted random between min, max (exclusive)

    Parameters

    • min: number

      minimum value.

    • max: number

      maximum value.

    Returns number

    random value

    // Print a random number; one of 5, 6, 7, 8, 9
    console.log(math.weightedRandom(5, 10) );