title: Javascript how to add active class to clicked element and hide all others
body: <p>I have a list-item-menu, where when I click on one of them it gets an active class, while I want all other list-items to get hidden but I'm not sure how to do that.</p>
  <p>Here is my script so far:</p>
  <pre><code>const items = document.querySelectorAll('.menu-item');
  
  items.forEach((item) =&gt; {
     item.addEventListener('click', (e) =&gt; {
        item.classList.toggle('active')
  
        // HIDE ALL OTHER &quot;item&quot;-elements
    })
  });
  </code></pre>
  <p>can someone help me out?</p>