Easy Operators
Filter Even Numbers
Traducción al español en progresoEl contenido detallado de esta lección aún se está traduciendo. Mientras tanto, se muestra en inglés.
Create a Flux emitting integers 1 through 10. Use the filter operator to keep only even numbers. Subscribe and print each on a new line.
filter() tests each element against a predicate, only passing through those that match.
Esperado
2 4 6 8 10
Main.kt