title: Is there a way of writing switch statements or other solutions for querySelectors?
body: <p>I currently have </p>
  
  <pre><code>if (element.querySelector('h1:first-child') || element.querySelector('container')) {
       removeBorderClass();
  }
  
  if (element.querySelector('h3:first-child')) {
       removeBorderClass();
  }
  </code></pre>
  
  <p>But obviously this is a bad practice in JavaScript.</p>
  
  <p>Can I use Switch case</p>
  
  <pre><code>switch(element.querySelector())
       case 'h3:first-child' || 'container'
       break;
  //this is an example
  </code></pre>
  
  <p>or is there even better solution for this?</p>
  
  <pre><code>&lt;section&gt;
      &lt;h1&gt;h1 is first child of section&lt;/h1&gt;
      //it should remove the border
  &lt;/section&gt;
  
  &lt;section&gt;
      &lt;h2&gt;h1 is first child of section&lt;/h2&gt;
      //it should not remove the border
  &lt;/section&gt;
  </code></pre>