11440 }
11441 for (let i2 = 0; i2 < removes.length; i2++) {
11442 let key = removes[i2];
11443 if (!!lookup[key]._x_effects) {11444 lookup[key]._x_effects.forEach(dequeueJob);11445 }11446 lookup[key].remove();
11447 lookup[key] = null;
11448 delete lookup[key];
11556 el._x_currentIfEl = clone2;
11557 el._x_undoIf = () => {
11558 walk2(clone2, (node) => {
11559 if (!!node._x_effects) {11560 node._x_effects.forEach(dequeueJob);11561 }11562 });
11563 clone2.remove();
11564 delete el._x_currentIfEl;
571 };
572 function hr(e) {
573 let t = e.parentNode;
574 if (!!t) 575 return t._x_hidePromise ? t : hr(t); 576 }
577 function Me(e, t, { during: r, start: n, end: i } = {}, o = () => {
578 }, s = () => {
442 });
443 }
444 function Q(e, t) {
445 if (!!e) { 446 if (t(e)) 447 return e; 448 if (e._x_teleportBack && (e = e._x_teleportBack), !!e.parentElement) 449 return Q(e.parentElement, t); 450 } 451 }
452 function dr(e) {
453 return fr().some((t) => e.matches(t));
In contexts such as an if
statement's test where the result of the expression will already be coerced to a Boolean
, casting to a Boolean
via double negation (!!
) or a Boolean
call is unnecessary.
const cond = !!!isPresent;
const cond2 = Boolean(!!isPresent);
if (!!cond) {
// ...
}
if (Boolean(cond2)) {
// ...
}
while (!!cond3) {
// ...
}
do {
// ...
} while (Boolean(cond));
for (; !!cond; ) {
// ...
}
const cond = !!isPresent;
const cond2 = Boolean(isPresent);
function checkCond() {
return !!isPresent;
}
const cond3 = !!(isPresent ? flag : flag2);