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

     1  ---
     2  layout: docs
     3  page_title: length - Functions - Configuration Language
     4  description: The length function determines the length of a collection.
     5  ---
     6  
     7  # `length` Function
     8  
     9  `length` determines the length of a given list, map, or tuple.
    10  
    11  If given a list, map, or tuple, the result is the number of elements in that
    12  collection.
    13  
    14  ## Examples
    15  
    16  ```shell-session
    17  > length([])
    18  0
    19  > length(["a", "b"])
    20  2
    21  > length({"a" = "b"})
    22  1
    23  ```