Angular · Middle · Question 55 of 75
What does the scan operator do?
clicks$.pipe(scan((total) => total + 1, 0))- ✓Correct answer: Accumulates state over time and emits each intermediate result, like a running
reduce - 2Emits only the final total when the stream completes
- 3Scans the DOM for elements
Explanation
reduce waits for completion; scan emits after every value, which suits counters or a reducer-like state stream.