Array Elements generator

Returns a subset with random elements of the given array in random order.

helpers.arrayElements

Generator settings

Generate data to see results here.

Parameters & Example

Returns a subset with random elements of the given array in random order.

helpers.arrayElements(array: ReadonlyArray<T>, count?: NumberOrRange)
array
Array to pick the value from.
count
Number or range of elements to pick. When not provided, random number of elements will be picked. When value exceeds array boundaries, it will be limited to stay inside.

Example

["alpha","gamma"]

Use synthetic data in a test environment.

Related generators

Explore scenarios