title: How these logical operators work?
body: <p>I'm trying to understand how this line works:</p>
  
  <pre><code>var dependencies = mod &amp;&amp; mod.dependencies || [];
  </code></pre>
  
  <p>This line of code exists within a function that takes mod as a parameter and mod is an object. My understanding is that first it (by the way, for the sake of precision what is "it" here? is "it" the engine?) will check if both mod and mod.dependencies resolve to true, if so, the || operator will be short circuited and mod.dependencies will return. If either are false, the empty array will return.</p>
  
  <p>I don't understand, though, why it looks for both mod and mod.dependencies. Can mod.dependencies exist without mod? Why not just look for mod.dependencies?</p>