title: Should hasClass precede removeClass - pure Javascript
body: <p>To remove the class, I use</p>
  
  <pre><code>getElementsByClassName("myclass1")[i].classList.remove("myclass2")
  </code></pre>
  
  <p>based on HTML5 Techniques. (I know that's not for IE9-, that's for browsers only).</p>
  
  <p>As far as I know it is absolutely fine do not check if class exists. Right?</p>
  
  <p>However, in my case there are many items with <code>myclass1</code> on the page where I want to remove <code>myclass2</code>, but most of them (let's say 90%) do not have <code>myclass2</code>. </p>
  
  <p>Will checking if the class <code>myclass2</code> exists will help to increase the performance as checking if exists could be much faster than delete? (still not sure about my last statement)</p>
  
  <p>What would you do in my case?</p>
  
  <p>Thank you.</p>