shuffle

The shuffle function takes all of the arguments and randomly mixes them up, much like shuffling a deck of cards.


shuffle( item, item, item, …. item )

Returns a new collection that contains all of the items provided to the function but with the order of items shuffled.

Arguments

A collection of individual items (whatever you want) to shuffle.

Example

Shuffle a bunch of items, and then print out the resulting collection in shuffled order.

Might print out “Banana”, “Apple” “Carrot”, “Elephant”, and then “Date”.


shuffle( collection )

shuffles all the items in the given collection.

Arguments

Pass in a collection object; note that if you pass in two or more collections then all the collections will be joined together and then shuffled

Returns

A single collection that contains all of the items in all of the given collections, shuffled.

Example

shuffle a collection of words and then print out the mixed-up collection.

Might print out “Date”, “Elephant”, “Carrot”, “Apple”, and then “Banana”.