mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
24 lines
436 B
Markdown
24 lines
436 B
Markdown
---
|
|
title: collections.Slice
|
|
description: Returns a slice composed of the given values.
|
|
categories: []
|
|
keywords: []
|
|
action:
|
|
aliases: [slice]
|
|
related:
|
|
- functions/collections/Dictionary
|
|
returnType: any
|
|
signatures: ['collections.Slice [VALUE...]']
|
|
aliases: [/functions/slice]
|
|
---
|
|
|
|
```go-html-template
|
|
{{ $s := slice "a" "b" "c" }}
|
|
{{ $s }} → [a b c]
|
|
```
|
|
|
|
To create an empty slice:
|
|
|
|
```go-html-template
|
|
{{ $s := slice }}
|
|
```
|