Logical AND (&&) operator: I've used the logical AND (&&) operator to conditionally execute the addEventListener method. In JavaScript, if the first operand of the && operator is falsy, the second operand is not evaluated. This makes the code more concise and eliminates the need for an if statement.
parent
a6dbceec24
commit
436419230f
|
|
@ -1325,9 +1325,7 @@ onUiLoaded(async () => {
|
|||
}
|
||||
};
|
||||
|
||||
if (isExtension) {
|
||||
targetElement.addEventListener("mousemove", checkForOutBox);
|
||||
}
|
||||
isExtension && targetElement.addEventListener("mousemove", checkForOutBox);
|
||||
|
||||
// Prevents sticking to the mouse
|
||||
window.onblur = function () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue