It seems that the following technique for checking the existence of an object member produces an error because the \'bar\' parent object hasn\'t been declared before the che
The simplest test is:
if (foo && foo.bar) { // play with foo.bar.myVal ... }