Picks a given number of random elements from the array. It won't pick the same element twice (unless the array has duplicates).
If the number of elements to pick is greater than the array length, it will return the original array.
source array
number of elements to pick
if true, it will shuffle the values if elementsToPick is greater or equal to array length instead of returning the original array
Picks a given number of random elements from the array. It won't pick the same element twice (unless the array has duplicates).
If the number of elements to pick is greater than the array length, it will return the original array.