String(s)
instead 111 r && l.isElement(r)
112 ? "element"
113 : (s = r) === null || typeof s == "undefined"
114 ? "" + s 115 : {}.toString
116 .call(s)
117 .match(/\s([a-z]+)/i)[1]
Boolean(e.flipVariationsByContent)
instead1975 (!_ && r === "start" && m) ||
1976 (!_ && r === "end" && g)),
1977 y =
1978 !!e.flipVariationsByContent &&1979 ((_ && r === "start" && p) ||
1980 (_ && r === "end" && h) ||
1981 (!_ && r === "start" && g) ||
Boolean(e.flipVariations)
instead1969 (i === "bottom" && g),
1970 _ = ["top", "bottom"].indexOf(i) !== -1,
1971 b =
1972 !!e.flipVariations &&1973 ((_ && r === "start" && h) ||
1974 (_ && r === "end" && p) ||
1975 (!_ && r === "start" && m) ||
Number(n)
instead1777 s = i.split("-")[0],
1778 l = void 0;
1779 return (
1780 (l = _t(+n) ? [+n, 0] : kt(n, r, a, s)),1781 s === "left"
1782 ? ((r.top += l[0]), (r.left -= l[1]))
1783 : s === "right"
Number(n)
instead1777 s = i.split("-")[0],
1778 l = void 0;
1779 return (
1780 (l = _t(+n) ? [+n, 0] : kt(n, r, a, s)),1781 s === "left"
1782 ? ((r.top += l[0]), (r.left -= l[1]))
1783 : s === "right"
Prefer using explicit casts by calling Number
, Boolean
, or String
over using operators like +
, !!
or "" +
.
This is considered best practice as it improves readability.
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;
const b = Boolean(foo);
const n = Number(foo);
const s = String(foo);