Function weightedRandom

  • return a weighted random array element, favoring the earlier entries

    Type Parameters

    • T

    Parameters

    • arr: T[]

      array to pick a element

    Returns T

    random member of array