filter method

Set<T> filter(
  1. bool pred(
    1. T
    )
)

Call the given predicate on each item in the collection and for each item that it returns true, collect the item in a new Set.

Unlike Iterator#filter, this returns a Set, not an Iterator. @expose @param {function(T):boolean} pred This function must not have any side-effects. @return {Set.

Implementation

_i3.Set<T> filter(_i2.bool Function(T) pred) => _i4.callMethod(
      this,
      'filter',
      [_i4.allowInterop(pred)],
    );