diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/markdown/snippets/add_dict_values.md | 12 | ||||
| -rw-r--r-- | docs/yaml/elementary/dict.yml | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/docs/markdown/snippets/add_dict_values.md b/docs/markdown/snippets/add_dict_values.md new file mode 100644 index 000000000..0b97a704e --- /dev/null +++ b/docs/markdown/snippets/add_dict_values.md @@ -0,0 +1,12 @@ +## Added a `values()` method for dictionaries + +Mesons built-in [[@dict]] type now supports the [[dict.values]] method +to retrieve the dictionary values as an array, analogous to the +[[dict.keys]] method. + +```meson +dict = { 'b': 'world', 'a': 'hello' } + +[[#dict.keys]] # Returns ['a', 'b'] +[[#dict.values]] # Returns ['hello', 'world'] +``` diff --git a/docs/yaml/elementary/dict.yml b/docs/yaml/elementary/dict.yml index 70844bb3b..3a5c484dd 100644 --- a/docs/yaml/elementary/dict.yml +++ b/docs/yaml/elementary/dict.yml @@ -46,3 +46,8 @@ methods: - name: keys returns: array[str] description: Returns an array of keys in the dictionary. + +- name: values + returns: array[any] + description: Returns an array of values in the dictionary. + since: 1.10.0 |
