title: What's the correct way to check return value from `querySelectorAll`?
body: <p>When using <code>querySelectorAll</code>, what is the correct way to check if it returned any elements?</p>
  
  <p>It returns something that can't be checked for <code>false</code>. This doesn't seem to work:</p>
  
  <pre><code>var elements = document.querySelectorAll('.class');
  if (elements) {
    // doesn't work, `elements` is always true
  }
  </code></pre>
  
  <p>Right now I'm doing the following check via <code>.length</code> property:</p>
  
  <pre><code>var elements = document.querySelectorAll('.class');
  if (elements.length) {
    // querySelectorAll returned DOM elements
  }
  </code></pre>
  
  <p>Is this how you do it?</p>