Destructing is cool but I start to encounter serious issues when doing destructing of nested objects. I have this code:
const {
credit: { amont },
} = userProfile
This is dangerous because what if credit is null? the whole app breaks. How do I prevent this? I know one way is to use Typescript but I'd rather not. I start to doubt destructing for nested has no difference from using dot.
