I'm tired of null validations to prevent undefined errors, like:
function do(){
if(!!object && !!object.childObject && !!object.childObject.prop)
doSomethingWithProp(object.childObject.prop);
}
Why?
If the validation was only if(!!object.childObject.prop)
I could get undefined
error with childObject
or object
.