Sudoku review #1
@ -13,7 +13,7 @@ class EventHandler {
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user
Simplified the empty event handler assignment. It was meant to be
??=
not||=
both will work in this case because of you how JS works though