Randomise order of a list

shuffle  list (array)

Returns a new list with the same elements as the original but with their order shuffled. Also works for strings

Introduced in v2.1

Examples

# Example 1

shuffle [1, 2, 3, 4]



#=> Would return something like: [3, 4, 2, 1]



# Example 2

shuffle "foobar" 



#=> Would return something like: "roobfa"