I'm checking if a nested object item named "token" is empty or not, in AngularIDE with Angular4
if (typeof this.user.data.token !== "undefined")
this is throwing <Cannot read property 'token' of null>
Should I necessarily check for every nested object existance?
You have to ...
if (this.user && this.user.data && this.user.data.token) {
}