Let's say fruitsArray = ["apple", "orange", "pear", "banana", "cherry", "blueberry", "papaya", "litchi"].
How to randomly pick four elements from this array without repeating?
Example result would be ["orange", "pear","blueberry","litchi"]
while result like ["apple", "orange","orange","papaya"] is not acceptable.
Aucun commentaire:
Enregistrer un commentaire