ary.shuffle â new_ary
ary.shuffle(random: rng) â new_ary
ary.shuffle(random: rng) â new_ary
Instance Public methods
Returns a new array with elements of self
shuffled.
1 2 | a = [ 1 , 2 , 3 ] #=> [1, 2, 3] a.shuffle #=> [2, 3, 1] |
The optional rng
argument will be used as the random number
generator.
1 | a.shuffle(random: Random. new ( 1 )) #=> [1, 3, 2] |
Please login to continue.