title: How to get other index from the current index
body: <p>i'm a newbie on JavaScript, help me to fix the problem i got.
  I have an array, i want to remove class list for other div which are not same with the current index. Please help </p>
  
  <p>i tried to find the answer from other discussion, but i still don't get what i want.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>window.addEventListener("load", ()=&gt; {
  const sounds = document.querySelectorAll(".sound");
  const pads = document.querySelectorAll(".pads div");
  const visual = document.querySelector(".visual");
  
  pads.forEach((pad, index) =&gt; {
      pad.addEventListener("click", function() {
          sounds[index].currentTime = 0;
          sounds[index].play();
          popUpNote();
  
          const ind = index + 1;
          //I Need to got the other index from the current index,
          //like if current index is 2, then i want to get 0,1,3,4,5
          //since i have 6 index inside
          pad.classList.add("active-pad"+ind);
  
          sounds[index].addEventListener("ended", function() {
              const noteChild = document.querySelector(".visual div");
              noteChild.remove();
              pad.classList.remove("active-pad"+ind);
          });
      });
  });
  
  const popUpNote = () =&gt; {
      const note = document.createElement("div");
      visual.appendChild(note);
      note.style.animation = 'beatOn 1.5s ease-in-out infinite both';
  };
  </code></pre>
  
  <p>});</p>
  
  <p>I want to got the other index from the current index, like if the current index is 2, then i want to get 0,1,3,4,5 since i have 6 index inside</p>