title: using a function to sort odd and even numbers Javascript
body: <p>Hi everyone I am trying to make a function to sort the odd and even numbers of an array and then display the total of each to my webpage. I don't get any response when I run my code. Could anyone tell me if they see something wrong I don't? Thanks ahead of time.
      var numList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];</p>
  
  <pre><code>function numberTally(numList){ 
  
  var evenTotal = 0;
  var oddTotal = 0;
  
  for (var i = 0; i &lt; numList.length; i++) {
  
      if (i % 2) {  // i is odd
  
          oddTotal += numList[i];
          // or oddTotal = oddTotal + numList[i];
  
      }
      else (i % 3){  // i is even
  
          evenTotal += numList[i];
  
  
  
  }
  }
  
  alert(oddTotal);
  return evenTotal;
  
  }  
  </code></pre>