title: Square all the numbers at an array's odd indices
body: <p>I'm trying to square all the integers at odd indices so that I can add up the whole array later. This is where I am so far:</p>
  
  <pre><code>function verryNiceFunc(arr) {
      var x = arr.filter(function(num) {
          if (num % 2) return num;
      }).reduce(function(previousValue, currentValue, index, array) {
        return previousValue + currentValue;
      });
      var y = arr.filter(function(num) {
          if (num % 2 != 1) return num;
      }).reduce(function(previousValue, currentValue, index, array) {
        return (currentValue * currentValue);
      });
      console.log(y);
      return x + y;
  }
  
  verryNiceFunc([5, 6, 7, 8, 9, 10, 11, 12]);
  //Should return 376
  </code></pre>
  
  <p>As you can see, var y needs a little editing. Think I need a for loop but not sure how to get it done.</p>
  
  <p><a href="http://jsfiddle.net/marcusdei/xez8obd3/11/" rel="nofollow">http://jsfiddle.net/marcusdei/xez8obd3/11/</a></p>