mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 08:18:30 +00:00
docs: Document symdiff
Closes https://github.com/gohugoio/hugoDocs/issues/659
This commit is contained in:
1 parent
4bc6071e61
commit
b8672f3d45
1 file changed
+28
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
title: "symdiff"
|
||||||
|
description: "`collections.SymDiff` (alias `symdiff`) returns the symmetric difference of two collections."
|
||||||
|
date: 2018-11-07
|
||||||
|
categories: [functions]
|
||||||
|
menu:
|
||||||
|
docs:
|
||||||
|
parent: "functions"
|
||||||
|
keywords: [collections,intersect,union, complement]
|
||||||
|
signature: ["COLLECTION | symdiff COLLECTION" ]
|
||||||
|
hugoversion: "0.51"
|
||||||
|
aliases: []
|
||||||
|
---
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```go-html-template
|
||||||
|
{{ slice 1 2 3 | symdiff (slice 3 4) }}
|
||||||
|
```
|
||||||
|
|
||||||
|
The above will print `[1 2 4]`.
|
||||||
|
|
||||||
|
Also see https://en.wikipedia.org/wiki/Symmetric_difference
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user