Bird
0
0

Which type of Subject in Angular immediately sends the last emitted value to new subscribers?

easy🧠 Conceptual Q11 of 15
Angular - RxJS and Observables Fundamentals
Which type of Subject in Angular immediately sends the last emitted value to new subscribers?
AAsyncSubject
BBehaviorSubject
CReplaySubject
DSubject
Step-by-Step Solution
Solution:
  1. Step 1: Understand BehaviorSubject behavior

    BehaviorSubject stores the last emitted value and sends it immediately to any new subscriber.
  2. Step 2: Compare with other Subjects

    Subject sends only to current subscribers without remembering past values. ReplaySubject replays multiple past values, not just the last one.
  3. Final Answer:

    BehaviorSubject -> Option B
  4. Quick Check:

    Last value sent immediately = BehaviorSubject [OK]
Quick Trick: BehaviorSubject always sends last value to new subscribers [OK]
Common Mistakes:
MISTAKES
  • Confusing ReplaySubject with BehaviorSubject
  • Thinking Subject remembers past values
  • Assuming AsyncSubject behaves like BehaviorSubject

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes