Once you start using optional chaining and really think about it, you should see that
if (user && user.profile && user.profile.avatar) {
console.log(user.profile.avatar);
}
is actually more reliable than
console.log(user?.profile?.avatar);
because the first approach has the "if" that allows for "else" - in a logical sense.
The compactness of optional chaining does not make it more reliable.
https://allthingssmitty.com/2025/06/02/write-more-reliable-javascript-with-optional-chaining/