をチェックし、私は私が正しくundefined
をチェックするための推奨in this questionに従ったと思った:「未定義」これはJavaScriptが悪いのかわからないが
if(typeof window.session.location.address.city != "undefined")
console.log(window.session.location.address.city);
しかし、上記のコードは、このエラーが発生します。
何Uncaught TypeError: Cannot read property 'city' of undefined
このチェックを行う正しい方法は?