title: With handlebars.js, is it ok to call nested object properties that may be undefined?
body: <p>I noticed that defining the following in my Handlebars.js templates works fine:</p>
  
  <pre><code>&lt;input name="username" value="{{user.name}}"&gt;
  </code></pre>
  
  <p>This works even when:</p>
  
  <ol>
  <li>user is undefined; and/or</li>
  <li>user.name is undefined</li>
  </ol>
  
  <p>However, I'm questioning how appropriate it is to do this. What's going on in the background? Wouldn't the following be more appropriate, albeit adding more cluttering?</p>
  
  <pre><code>&lt;input name="username" value="{{#if user}}{{#if user.name}}{{user.name}}{{/if}}{{/if}}"&gt;
  </code></pre>
  
  <p>Thanks.</p>