title: if with jquery returning undefined and not working
body: <p>I am opening dropdowns in bootstrap by adding show to their elements, which works fine. I am also trying to close other dropdowns that are open, which is what this function does.
  My function:</p>
  
  <pre><code>  function classremove() {
      var doesithavetheclass = $('div').hasClass('show');
      if (doesithavetheclass == 'true') {
        $('div').removeClass('show');
      };
      return doesithavetheclass;
    };
  </code></pre>
  
  <p>The <code>if</code> is the part that won't work. Running the code inside the <code>if</code> works, and defining the variable in the Chrome console works properly, but running the <code>if</code> inside of the Chrome console doesn't work even if before I defined the variable with dropdowns open with the show class. </p>