use
Boolean(byUser === true && !$tabId.is('[nu-data-clicked-by-system]'))
instead.3464
3465 const $tabId = $('#' + tab.id)
3466
3467 byUser = !!(byUser === true && !$tabId.is('[nu-data-clicked-by-system]'))3468
3469 if (byUser) nuSaveScrollPositions()
3470
Description
Prefer using explicit casts by calling Number
, Boolean
, or String
over using operators like +
, !!
or "" +
.
This is considered best practice as it improves readability.
Bad Practice
const b = !!foo;
// The `+` operator does not change the value of its operand
// unless it's already a number.
let n = +foo;
n = 1 * foo;
const s = "" + foo;
Recommended
const b = Boolean(foo);
const n = Number(foo);
const s = String(foo);