Check out example codes for "shuffle array swift". It will help you in understanding the concepts better.

Code Example 1

var numbers = [1, 2, 3, 4]
numbers.shuffle()
// numbers == [3, 2, 1, 4]

Learn ReactJs, React Native from akashmittal.com