4015 t = null != i && i + "queueHooks",
4016 n = S.timers,
4017 r = Y.get(this);
4018 if (t) r[t] && r[t].stop && a(r[t]); 4019 else for (t in r) r[t] && r[t].stop && it.test(t) && a(r[t]);
4020 for (t = n.length; t--; )
4021 n[t].elem !== this ||
3914 for (r in (f &&
3915 1 === e.nodeType &&
3916 ((n.overflow = [h.overflow, h.overflowX, h.overflowY]),
3917 null == (l = v && v.display) && (l = Y.get(e, "display")), 3918 "none" === (c = S.css(e, "display")) &&
3919 (l
3920 ? (c = l)
3908 if ("show" !== i || !v || void 0 === v[r]) continue;
3909 g = !0;
3910 }
3911 d[r] = (v && v[r]) || S.style(e, r); 3912 }
3913 if ((u = !S.isEmptyObject(t)) || !S.isEmptyObject(d))
3914 for (r in (f &&
3675 (this.now = (this.end - this.start) * t + this.start),
3676 this.options.step &&
3677 this.options.step.call(this.elem, this.now, this),
3678 n && n.set ? n.set(this) : Ke.propHooks._default.set(this), 3679 this
3680 );
3681 },
3673 ))
3674 : (this.pos = t = e),
3675 (this.now = (this.end - this.start) * t + this.start),
3676 this.options.step && 3677 this.options.step.call(this.elem, this.now, this), 3678 n && n.set ? n.set(this) : Ke.propHooks._default.set(this),
3679 this
3680 );
The optional chaining operator can be used to perform null checks before accessing a property, or calling a function.
Using &&
for this purpose is no longer required.
function getUsernameFromId(id: number): string | undefined {
const user = db.getUser(id)
return user && user.name
}
someFunc && someFunc()
// ^~~~ not necessary
maybeArray && maybeArray[index]
// ^~~~ not necessary
function getUsernameFromId(id: number): string | undefined {
const user = db.getUser(id)
return user?.name
}
someFunc?.()
maybeArray?.[index]