The type of the elements in the input array.
The input array from which to select random elements.
Optional. The number of random elements to return. Defaults to 1.
A Result
object with either the selected random element(s), or an Error
object if
the provided input is not an array.
Generated using TypeDoc v0.24.7
Returns a random element or an array of random elements from an input array without modifying the original array. Only elements of type
number
,string
, orboolean
are considered valid.Example