Simple question: writing code in javascript, I find myself write the same lines of code over and over:
if (!obj.field) obj.field={};
obj.field.inner_field='val';
In order to protect myself from cases where obj.field is not defined. Is there a more elegant way to do it?
Thanks!