Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "random/sample/docs/types/index.d"

Index

Type aliases

SampleFunction

SampleFunction: (x: ArrayLike<any>, options?: Options) => Array<any>

Samples elements from an array-like object.

param

array-like object from which to sample elements

param

function options

param

sample size

param

element probabilities

param

boolean indicating whether to sample with replacement (default: true)

throws

must provide valid options

throws

size option must be less than or equal to the length of x when the replace option is false

returns

sample

Type declaration

SamplePopFunction

SamplePopFunction: (options?: PopOptions) => Array<any>

Samples elements from a population.

param

function options

param

sample size

param

boolean indicating whether to sample with replacement (default: true)

param

boolean indicating whether to mutate the pool when sampling without replacement (default: false)

throws

must provide valid options

throws

size option must be less than or equal to the population when the replace option is false

returns

sample

Type declaration

Variables

Export assignment sample

sample: Sample

Samples elements from an array-like object.

param

array-like object from which to sample

param

function options

param

sample size

param

element probabilities

param

boolean indicating whether to sample with replacement (default: true)

throws

must provide valid options

throws

size option must be less than or equal to the length of x when the replace option is false

returns

sample