title: How can I make this to a loop?
body: <p>How can I make this to a loop? the array tabProsent contains 70 numbers.</p>
  <pre><code>var startVerdi=1000;
  
   if(slider.value==tab[0]){
      output2.innerHTML = startVerdi*tabProsent[0];
    }
  
    if(slider.value==tab[1]){
      output2.innerHTML = startVerdi*tabProsent[0]*tabProsent[1];
    }
  
    if(slider.value==tab[2]){
      output2.innerHTML = startVerdi*tabProsent[0]*tabProsent[1]*tabProsent[2];
    }
  
    if(slider.value==tab[3]){
      output2.innerHTML = startVerdi*tabProsent[0]*tabProsent[1]*tabProsent[2]*tabProsent[3];
  }
  </code></pre>