I have in many places in my code the following format:
if (a && a.b && a.b.c && a.b.c.d) {
//do something with a.b.c.d
}
Given a,b,c and d have a more complex names this is very ugly, time consuming and open places for mistakes.
Is there a "sugarcoating" for this, something like:
if (valid(a.b.c.d)) {
//do something with a.b.c.d
}