The central idea is that the function doesn't create a copy of the array. It just modifies the array, like myArray.sort(). Likewise, the function doesn't return a value. The function is designed to shuffle an existing array, not to create a new array of random values. The code doesn't duplicate numbers because it's only swapping values, not generating new ones.
If you comment out those lines, there are no longer any commands that modify the array.Quote:
but if you comment the turn-around and either randA or randB out of the function, it returns an ordered list 1,2,3,4,...20
