Type alias WeightedArray<T>

WeightedArray<T>: [number, T][]

An array of tuples, the first value being the weight of probability (higher is more probable), and the value under the weight.

Type Parameters

  • T = unknown

    The type of the value being selected by weight.