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

Code Example 1

[1,2,3,4].shuffle => [2, 1, 3, 4]
[1,2,3,4].shuffle => [1, 3, 2, 4]

Learn ReactJs, React Native from akashmittal.com