title: Clean up if statement Javascript
body: <p>I do have jQuery and wouldn't mind using it but here's the code I would like to clean up:</p>
  
  <pre><code>if (parent.uglyChild.uglyChild.uglyChild.uglyChild.data == null) {
      parent.uglyChild.uglyChild.uglyChild.uglyChild.data = new app.newData();
  }
  </code></pre>
  
  <p>The only way I know how to clean it up is:</p>
  
  <pre><code>var data = parent.uglyChild.uglyChild.uglyChild.uglyChild.data;
  if (data == null) { data = new app.newData()}
  </code></pre>
  
  <p>I have always wondered if there was a way to do something like:</p>
  
  <pre><code>parent.uglyChild.data = parent.uglyChild.data.isNull ? return : new app.newData();
  </code></pre>
  
  <p>I can't wait to see the shorthand tricks you guys know! :)</p>