I have a simple, quick question. There's a lot of situation where we have to check if props are undefined.
What about nested props, for example we have:
this.props.data.income.data1.value.chartData
and we want to check if chartData exist
it has to be a better, more clear way than
if(
this.props.data &&
this.props.data.income &&
this.props.data.income.data1 &&
this.props.data.income.data1.value &&
this.props.data.income.data1.value.chartData!==null
)
I cant just check this.props.data.income.data1.value.chartData!==null
Please tell me how do you solve it in your projects?