Skip to content

List Flatten

The list::flatten function takes a nested list and returns a single-level list containing all elements.

Syntax

list::flatten(<nested-list>)

Parameters

  • nested-list: The input list containing nested lists to be flattened.

Returns

  • List: A single-level list with all elements from the nested lists.

Example

Try it out below!
list::flatten([[1, 2], [3, 4], [5]])

This function is useful for simplifying complex, multi-level data structures into a single, manageable list.