Rest
...ns: [number, number][]Any number of [weight, number]
tuples.
For example:
weightedAverage([1, 0], [3, 1])
returns 0.75
.
0
, three parts 1
. That adds up to four parts, which means each part is worth 0.25
. 1
means 0.25 * 3
, one part 0
means 0 * 1
.0.75 + 0
is 0.75
.Generated using TypeDoc
Takes an any number of
[weight, number]
tuples, and returns the "weighted average".