title: Check if variable is defined and checking its property in the same conditional in PugJS
body: <p>I'm supplying a variable <code>items</code> to a pug view, and I want to present the same result for the case where the variable is either an empty list or <code>undefined</code>.</p>
  <p>I'd expect that this can be done with the <code>&amp;</code> operator like</p>
  <pre><code>if typeof(items) != 'undefined' &amp; items.length &gt; 0
      each item in items
          p item
  else
      p no items here :(
  </code></pre>
  <p>but based on the error message for when <code>items</code> is either missing or <code>undefined</code>, pug is evaluating both sides of <code>&amp;</code> operator.</p>
  <pre><code>Cannot read property 'length' of undefined
  </code></pre>
  <p>An obvious solution is to perform this check in the JS calling the view, but I'm wondering if there's a way to do this in a single conditional in pug.</p>