Returns a random element from the array or undefined if the array is empty.
undefined
randomChoice([1, 2, 3, 4, 5])// 2 Copy
randomChoice([1, 2, 3, 4, 5])// 2
Returns a random element from the array or
undefined
if the array is empty.