In my code, I deal with an array that has some entries with many objects nested inside one another, where as some do not. It looks something like the following:
I usually use like this:
var x = object.any ? object.any.a : 'def';