title: Average jagged array by index
body: <p>I have an array of arrays that looks like: <code>var data = [[2, 2,3], [3, 9], [5, 6,7,8]];</code>
  (<a href="http://jsfiddle.net/h6FzN/" rel="nofollow">fiddle here</a>)
  I need to be able to create a new array based on each inner array's index. So from the above output I'm looking for</p>
  
  <pre><code>1 - [2,3,5]
  2 - [2,9,6]
  3 - [3,7]
  4 - [8]
  </code></pre>
  
  <p>helper average method: </p>
  
  <pre><code>Array.prototype.average = function () {
          var sum = this.sum();
          return sum / this.length;
      };
  </code></pre>
  
  <p>I've got something like :</p>
  
  <pre><code>var data = [[2, 2,3], [3, 9], [5, 6,7,8]];
      //Sconsole.log(data);
  
      Array.prototype.averageAll = function () {
          var avgArrays = [[]];
          var self = this;
  
          for (var i = 0; i &lt; self.length; i++) {
              avgArrays[0].push(self[i][0]);
          }
          return avgArrays[0].average();
      };
      //3.333 to the console
      console.log(data.averageAll());
  </code></pre>
  
  <p>I've hardcoded in the season here because if I try to use <code>avgArrays[i][i]</code> I get an error <code>push is not defined</code>.  For my simple example, the function calculates the average of the 0th position of each array in the array. If I have arrays of varying sizes like this, how can I make this go slickly in one fell swoop?</p>