The filter operator

The filter method takes a predicate, and if a value from the upstream doesn't meet a condition of the predicate, it isn't passed to the downstream.

A predicate is a function that takes parameters and returns a Boolean value.

The following diagram shows how the filter method works in the previous example:

In this example, the filter operator is only used to receive odd numbers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.134.151