randomElem

Gets a random element an array. A single element is returned by default.
Specify the multi parameter to get an array of multiple random elements.

If the array is empty, undefined is returned.
If multi is defined it returns an empty array.

It uses crypto.getRandomValues to get the random element.

Example