2018-06-02 03:56:34 +02:00
|
|
|
---
|
2021-12-15 03:41:17 +01:00
|
|
|
page_title: values - Functions - Configuration Language
|
|
|
|
description: The values function returns a list of the element values in a given map.
|
2018-06-02 03:56:34 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# `values` Function
|
|
|
|
|
|
|
|
`values` takes a map and returns a list containing the values of the elements
|
|
|
|
in that map.
|
|
|
|
|
|
|
|
The values are returned in lexicographical order by their corresponding _keys_,
|
|
|
|
so the values will be returned in the same order as their keys would be
|
2021-12-15 03:41:17 +01:00
|
|
|
returned from [`keys`](/language/functions/keys).
|
2018-06-02 03:56:34 +02:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
```
|
|
|
|
> values({a=3, c=2, d=1})
|
|
|
|
[
|
|
|
|
3,
|
|
|
|
2,
|
|
|
|
1,
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
|
|
|
## Related Functions
|
|
|
|
|
2021-12-15 03:41:17 +01:00
|
|
|
* [`keys`](/language/functions/keys) returns a list of the _keys_ from a map.
|