hugo/docs/content/en/functions/collections/Shuffle.md
2023-10-20 09:43:56 +02:00

612 B

title linkTitle description keywords categories keywords menu function relatedFunctions aliases
collections.Shuffle shuffle Returns a random permutation of a given array or slice.
ordering
functions
docs
parent
functions
aliases returnType signatures
shuffle
any
collections.Shuffle COLLECTION
collections.Reverse
collections.Shuffle
collections.Sort
collections.Uniq
/functions/shuffle

title: collections.Shuffle linkTitle: shuffle description: Returns a random permutation of a given array or slice. keywords: [ordering] categories: [functions] keywords: [] menu: docs: parent: functions function: aliases: [shuffle] returnType: any signatures: [collections.Shuffle COLLECTION] relatedFunctions:

  • collections.Reverse
  • collections.Shuffle
  • collections.Sort
  • collections.Uniq aliases: [/functions/shuffle]

{{ shuffle (seq 1 2 3) }} → [3 1 2] 
{{ shuffle (slice "a" "b" "c") }} → [b a c] 

The result will vary from one build to the next.