The .groupBy() is one of the more complicated operators. As we have learned before, it groups elements emitted by the upstream Observable into a separate Observable based on a specified property or a key:

In the preceding figure, we can see that after applying .groupBy() operator, the new Observables are grouped by the shape of the original element.
The dashed arrows show how each element was mapped from the position in the original Observable into the new Observable.