Elixir Function of the Day

A start page for alchemists! Roll the dice.

List.flatten/2

 Share!

Function signature:

flatten(list, tail)

Documentation:

Flattens the given list of nested lists. The list tail will be added at the end of the flattened list.

Examples

iex> List.flatten([1, [[2], 3]], [4, 5])
[1, 2, 3, 4, 5]