compact<T> function

Iterable<T> compact<T>(
  1. Iterable<T?> items
)

Filters out all null values from Iterable.

[1, 2, null, 3].compact(); // [1, 2, 3]

Implementation

Iterable<T> compact<T>(Iterable<T?> items) => items.compact();