title: Understanding complex $.extend in modal.js
body: <p>I was just going through some code in modal.js and came across the following line of code:</p>
  
  <pre><code> var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' &amp;&amp; option)
  </code></pre>
  
  <p>The line mostly makes sense, except the last part, i.e.:</p>
  
  <pre><code>typeof option == 'object' &amp;&amp; option
  </code></pre>
  
  <p>I understand the <code>typeof</code> operator but I don't understand its usage in <code>$.extend</code>, can somebody explain please? </p>
  
  <p>My line of difficulty can be found in the plugin code online too . <a href="https://github.com/twbs/bootstrap/blob/master/js/modal.js#L296" rel="nofollow">Line 296</a>. </p>