11265 : q(this).val("")
11266 : r &&
11267 ((!0 === r && /hidden/.test(e)) ||
11268 ("string" == typeof r && q(this).is(r))) &&11269 (this.value = "");
11270 });
11271 }),
11259 ? (this.checked = !1)
11260 : "select" === t
11261 ? (this.selectedIndex = -1)
11262 : "file" === e11263 ? /MSIE/.test(navigator.userAgent)
11264 ? q(this).replaceWith(q(this).clone(!0))
11265 : q(this).val("")
11257 ? (this.value = "")
11258 : "checkbox" === e || "radio" === e
11259 ? (this.checked = !1)
11260 : "select" === t11261 ? (this.selectedIndex = -1)
11262 : "file" === e
11263 ? /MSIE/.test(navigator.userAgent)
10561 ? (M = { success: M })
10562 : "string" == typeof M || (!1 === M && 0 < arguments.length)
10563 ? ((M = { url: M, data: e, dataType: t }),
10564 "function" == typeof r && (M.success = r))10565 : void 0 === M && (M = {}),
10566 (O = M.method || M.type || this.attr2("method")),
10567 (n =
10489 return (
10490 void 0 === t &&
10491 (t =
10492 "undefined" != typeof window10493 ? require("jquery")
10494 : require("jquery")(e)),
10495 r(t),
Yoda conditions are named so because the literal value of the condition comes first while the variable comes second.
For instance,
if ("red" === color) {
// ...
}
Yoda condition is fixed by switching the literal and variable.
This is called a Yoda condition because it reads as, "if red equals the color", similar to the way the Star Wars character Yoda speaks. Compare to the other way of arranging the operands:
if (color === "red") {
// ...
}
This typically reads, "if the color equals red", which is arguably a more natural way to describe the comparison.
if ("red" === color) {
// ...
}
if (true == flag) {
// ...
}
if (5 > count) {
// ...
}
if (-1 < str.indexOf(substr)) {
// ...
}
if (color === "red") {
// ...
}
if (flag === true) {
// ...
}
if (count < 5) {
// ...
}
if (str.indexOf(substr) > -1) {
// ...
}