Optional Chaining (?.) allows you to access deeply nested properties without worrying if an intermediate property is null or undefined. Accessing a missing property simply returns undefined instead of throwing an error.
user object that might have a missing profile or addresszipCode from user.profile.address.zipCode into a variable zipuser.getDetails?.() (it might not exist!) and store in detailsSubmit your code to see test results