Why is this code NOT returning false? : <p>Referencing this straightforward conversation:
<a href="https://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery?rq=1">Is there an &quot;exists&quot; function for jQuery?</a></p>

<p>The following code is seeing a zero but still evaluating to 'true' for the first case. </p>

<p>Here is the console result:</p>

<blockquote>
  <p>Found listView: 0 / 14</p>
</blockquote>

<p>The code is in a dialog window...so perhaps it might see the element on the underlying page. But the zero in the log says otherwise...</p>

<p>Really frustrating edge case (or I've just lost my mind). Help appreciated.</p>

<pre><code>if (('#listViewMenu').length) {   //  We are on taskpane list view
        console.log('Found listView: ' + $('#listViewMenu').length + ' / ' + ('#tableViewMenu').length);
        addList();      //hardcoded to list view only - auto load if there is an existing choice for Group
      }
      if (('#tableViewMenu').length) {    //  We are in dialog window table view
        addTable();
      }
</code></pre>
