github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/collection/reverse.mdx (about) 1 --- 2 layout: docs 3 page_title: reverse - Functions - Configuration Language 4 sidebar_title: reverse 5 description: The reverse function reverses a sequence. 6 --- 7 8 # `reverse` Function 9 10 `reverse` takes a sequence and produces a new sequence of the same length 11 with all of the same elements as the given sequence but in reverse order. 12 13 ## Examples 14 15 ```shell-session 16 > reverse([1, 2, 3]) 17 [ 18 3, 19 2, 20 1, 21 ] 22 ``` 23 24 ## Related Functions 25 26 - [`strrev`](/docs/job-specification/hcl2/functions/string/strrev) reverses a string.