[Javascript] [events] how to understand the code [e = e || event]

This is a compatibility code that usually appears in the code of the event handler in
some browsers window.event event on the object, rather than on EventHandler.event parameters in the
meaning of this code is used when there is e e, e using the object does not exist window.event

Equivalent to


                let ev = (e != null) ? e : window.event;

Guess you like

Origin blog.csdn.net/u013718730/article/details/90477357