Next.js Discord

Discord Forum

Is there a easier way to check an deep object's inner properties?

Unanswered
Virginia's Warbler posted this in #help-forum
Open in Discord
Virginia's WarblerOP
This is more of a plain JS question. But lets say if I have deeply nested obejcts like xxx.yyy.zzz.aaa

I can do a series of checks to see: if xxx have yyy && if xxx.yyy have zzz && if xxx.yyy.zzz have aaa

But is there an easy way?

3 Replies

xxx?.yyy?.zzz?.aaa
@joulev xxx?.yyy?.zzz?.aaa
This would still give this warning