Alan · Weighted Array Element
Alan · Weighted Array Element · helpers.weightedArrayElement. Üretim yöntemi · Örnek
helpers.weightedArrayElement
Üretici ayarları
Sonuçları görmek için veri oluştur.
Parametreler & Örnek
Returns a weighted random element from the given array. Each element of the array should be an object with two keys weight and value.
helpers.weightedArrayElement(array: ReadonlyArray<{ weight: number; value: T; }>)- array
- Array to pick the value from.
- array[].weight
- The weight of the value.
- array[].value
- The value to pick.
Örnek
"draft"Test ortamında sentetik veri kullan.