Is there a clean way to check for this ?
I am using typescript, and I have a big object with many optional value
I want to access,
value1.subValue1.subsubValue1;
but if subValue1 that is optional is undefined, I get an error.
For the moment, I only know something like
if(value1 && value1.subValue1 && value1.subValue1.subsubValue1);
But is there something shorter ?
value1?.subValue1?.subsubValue1 but it doesn't work in my code