obj?.prop returns undefined instead of throwing if obj is null or undefined.
obj?.prop
undefined
obj
null
Challenge: Write safeAccess(obj) that returns:
safeAccess(obj)
name
obj?.user?.name ?? 'anonymous'
city
obj?.user?.address?.city ?? 'unknown'