mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-01-15 08:00:36 -05:00
This also renames some of the existing function pages whose source filenames were not matching the usual naming scheme (.html.md).
625 B
625 B
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| functions | flatten function | docs-funcs-collection-flatten | The flatten function eliminates nested lists from a list. |
flatten Function
flatten takes a list and replaces any elements that are lists with a
flattened sequence of the list contents.
Examples
> flatten([["a", "b"], [], ["c"]])
["a", "b", "c"]
If any of the nested lists also contain directly-nested lists, these too are flattened recursively:
> flatten([[["a", "b"], []], ["c"]])
["a", "b", "c"]
Indirectly-nested lists, such as those in maps, are not flattened.