Skip to content

Commit 05e1878

Browse files
authored
refactoring
more readable and more modern way
1 parent b0464bb commit 05e1878

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

1-js/09-classes/07-mixins/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ let eventMixin = {
154154
* this.trigger('select', data1, data2);
155155
*/
156156
trigger(eventName, ...args) {
157-
if (!this._eventHandlers || !this._eventHandlers[eventName]) {
157+
if (!this._eventHandlers?.[eventName]) {
158158
return; // no handlers for that event name
159159
}
160160

0 commit comments

Comments
 (0)