if i have an object like a.b.c.d = "exists"
and i want to check if (a.b.c.d){..}
is true.
Then how can i do it without getting an error. if obj a
doesn't exist. I get an error and program stops. I want program to continue and if obj a or b or c or d don't exist, just it should evaluate to false.
it makes sense if a
doesn't exit then so doesn't d
, why does browser give an error here? And how can i fix this i certianly don't want to do this: if (a && a.b && a.b.c && a.b.c.d) {..}