Upon using the combineLatest operator, I encountered an unexpected response when adjusting the interval duration of the first and second observables.
Here is an example of the code:
let intObs1$ = interval(1000).pipe(take(3));
let intObs2$ = interval(500).pipe(take(3));
combineLatest([intObs1$, intObs2$,]).subscribe(([intObs1, intObs2]) => {
console.log(intObs1, intObs2);
})`
The output displayed in the console is as follows: 0 0 0 1 1 1 2 1 2 2
However, upon making slight modifications:
let intObs1$ = interval(500).pipe(take(3));
let intObs2$ = interval(1000).pipe(take(3));
combineLatest([intObs1$, intObs2$,]).subscribe(([intObs1, intObs2]) => {
console.log(intObs1, intObs2);
});
The new output in the console is as follows: 1 0 2 0 2 1 2 2
I am curious as to why the second script does not emit the initial values of Zero/Zero. Any insights or explanations would be greatly appreciated.