Type Alias SampleOptionsExperimental

SampleOptions: RandomOptions & {
    weights?: ArrayLike<number>;
}

Options for sample.

UNSTABLE: New API, yet to be vetted.

Type declaration

  • Optional Experimentalweights?: ArrayLike<number>

    An array of weights corresponding to each item in the input array. If supplied, this is used to determine the probability of each item being selected.