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.
7 lines
96 B
JavaScript
7 lines
96 B
JavaScript
var street = user.address?.street
|
|
street = user.address?.street
|
|
|
|
test(a?.b, 1);
|
|
|
|
(1, a?.b, 2);
|