title: How to summize every second number in an Array?
body: <p>I'm having trouble summize every second/other number in an Array in Javascript. Any suggestions? (Using Norwegian functions, sorry for that!)
  Such as: 2, 4, 6, 8, 10 = 30..</p>
  
  <p>My function for the second/other number is</p>
  
  <pre><code>function tall(nummer) {
  var tall = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
  
  if (nummer == 5) {
      partall = tall.filter((_,i) =&gt; i&amp;1);
          document.getElementById("tall").innerHTML = partall;
  }
  </code></pre>
  
  <p>and for the final sum:</p>
  
  <pre><code>if (nummer == 9) {
      partall = tall.filter((_,i) =&gt; i&amp;1);
      partall += tall;
          document.getElementById("tall").innerHTML = partall;
  }
  </code></pre>