The last operator in this chapter, the skipWhile() operator, is analogous to the takeWhile() operator, but it skips the elements while a given conditional function is satisfied. It has the following signature:
The first parameter is mandatory and the second is optional:
- condition: This is a function to test the elements to be skipped
- context: This is an argument to be used in the condition function
To illustrate this operator, we can use the same example from the takeWhile(), but using the skipWhile() function instead:
Rx.Observable .of(2,4,5,6) .skipWhile((i)=>i%2===0) .subscribe((i)=>console.log(i));
In this code, we will skip the even elements starting from the ...