This way, it quickly returns from the conditions. The first nil will now exit, instead of checking every nil. This also allows conditionalChaining inside a container to still operate the container.
5 lines
182 B
JavaScript
5 lines
182 B
JavaScript
var _a, _a$b$c, _a$b, _a2;
|
|
|
|
(_a = a) == null ? void 0 : _a.b = 42;
|
|
|
|
(_a2 = a) == null ? void 0 : (_a$b = _a2.b) == null ? void 0 : (_a$b$c = _a$b.c) == null ? void 0 : _a$b$c.d = 42; |