RandomArray

Random generator for array objects.

Description

The RandomArray class can be used as a random generator for array objects.

Static methods

pick

Picks a random element from specified array.

public static pick<T>(values: T[]): T

  • values: T[] - an array of any type
  • returns: T - a randomly picked item.

Examples

let value1 = RandomArray.pick([1, 2, 3, 4]); // Possible result: 3