DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
Interview Prep Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
Interview Prep
In the condensed event emitter implementation, what does `(events[event] ??= []).push(handler)` do?
A
Always overwrites events[event] with a new empty array
B
Initializes events[event] to an empty array only if it's currently null/undefined, then pushes the handler onto it
C
Throws if events[event] doesn't exist yet
D
Removes all existing handlers before adding the new one
Check Answer