title: Trying to reduce redundancies
body: <p>I wrote some code, but I am pretty sure, that this could be shorter but my brain just stopped working and therefore I want to ask you about some tipps.
  The problem is, that there are kind of redundancies in the code and like I said, I am pretty sure, that some kind of loop or something could handle this problem.</p>
  
  <p>This piece of code is, like the name of the function, for toggling two different contents. This is for simulating a header with two tabs and therefore to present different content, when one of the two tabs are clicked.</p>
  
  <pre class="lang-js prettyprint-override"><code>function toggleContent() {
      if(!firstTab.classList.contains("active")) {
        firstTab.classList.add("active");
        secondTab.classList.remove("active");
        firstContent.classList.add("visible");
        secondContent.classList.remove("visible");
      } else {
        secondTab.classList.add("active");
        firstTab.classList.remove("active");
        secondContent.classList.add("visible");
        firstContent.classList.remove("visible");
      }
    }
  </code></pre>