summaryrefslogtreecommitdiffstats
path: root/docs/content/en/functions/collections/Shuffle.md
blob: 18b8cc664cd338462302c611f98bc3b19b15f0b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
title: collections.Shuffle
description: Returns a random permutation of a given array or slice.
categories: []
keywords: []
action:
  aliases: [shuffle]
  returnType: any
  signatures: [collections.Shuffle COLLECTION]
related:
  - collections.Reverse
  - collections.Shuffle
  - collections.Sort
  - collections.Uniq
aliases: [/functions/shuffle]
---

```go-html-template
{{ 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.