title: Backbone.js Model defaults and parse
body: <p>I've got this <code>Backbone.Model</code> representing a Google Books API volume:</p>
  
  <pre><code>    var Book = Backbone.Model.extend({
  
      defaults: {
          volumeInfo : {
              title: 'n.a.',
              authors: 'n.a.',
              publisher: 'n.a.',
              publishedDate: 'n.a.',
              imageLinks : {
                  smallThumbnail: '/unavailable.jpg'
              }
          }
      },
  
      parse: function(resp) {
          if (resp.volumeInfo.authors) {
              resp.volumeInfo.authors = resp.volumeInfo.authors.join(',');
          }
          return resp;
      }
  });
  </code></pre>
  
  <p>Which is fed to this template:</p>
  
  <pre><code>&lt;script type="text/template" id="bookCollectionRow"&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;img class="thumbnail" src="&lt;%= volumeInfo.imageLinks.smallThumbnail %&gt;" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;a target="_blank" href="&lt;%= volumeInfo.canonicalVolumeLink %&gt;"&gt;&lt;%= volumeInfo.title %&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= volumeInfo.authors %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= volumeInfo.publisher %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= volumeInfo.publishedDate %&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>Upon parsing the template, when a volume JSON does not contain an <code>imageLinks</code> I receive this error:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'smallThumbnail' of undefined.
  </code></pre>
  
  <p>I know I could fix it by checking with an <code>if</code> in the <code>Model</code> or in the <code>template</code> but what's the purpose of <code>defaults</code> model property then? Does that work only if not overriding <code>parse</code>?</p>