Gopher
FUNCTIONS

shuffle

Returns a random permutation of a given array or slice.

Syntax

shuffle COLLECTION
shuffle-input.html
<!-- Shuffled sequence = -->
<div>{{ shuffle (seq 1 5) }}</div>
<!-- Shuffled slice =  -->
<div>{{ shuffle (slice "foo" "bar" "buzz") }}</div>

This example would return the following:

shuffle-output.html
2 5 3 1 4
buzz foo bar

This example also makes use of the slice and seq functions.


Last updated: April 30, 2017