Correct null assigner instead of or assignment

This commit is contained in:
BordedDev 2025-01-17 00:10:56 +01:00
parent f1c1a02877
commit a24e32249b

View File

@ -13,7 +13,7 @@ class EventHandler {
} }
on(event, listener) { on(event, listener) {
this.events[event] ||= { name: name, listeners: [], callCount: 0 } this.events[event] ??= { name: name, listeners: [], callCount: 0 }
this.events[event].listeners.push(listener) this.events[event].listeners.push(listener)
} }