I thought I had correctly followed the recommendations in this question for checking undefined
:
if(typeof window.session.location.address.city != "undefined")
console.log(window.session.location.address.city);
But the code above generates this error:
Uncaught TypeError: Cannot read property 'city' of undefined
What's the correct way to perform this check?