flatten method

Iterable<T> flatten()

flatten iterable of iterable into iterable

example

[[1,2,3],[4,5,6],[7,8,9]].flatten() // => [1,2,3,4,5,6,7,8,9]

Implementation

Iterable<T> flatten() =>
    fold<Iterable<T>>([], (acc, element) => [...acc, ...element]);