github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/job-specification/hcl2/functions/collection/reverse.mdx (about)

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