JavaScript optional chaining (?.) to the rescue