title: Can this function be done with Array.prototype method
body: <p>I'm trying to adopt the new Array.prototype functions, and wondering how is this code can be done with it.</p>
  
  <p>The goal is, return the average value of every 12 object as an array from the original object array.</p>
  
  <pre><code>var WeatherData = [{tm:0,t:22,h:15,p:537}..
  var AverageWeather = []; 
  var temp = 0;
  
  for (i = 0; i &lt; WeatherData.length; i++) {
  
      temp += WeatherData[i].t;
      if ((i+1) % 12 == 0) {
      AverageWeather.push( Math.round((temp / 12) * 100) / 100 );
      Temp = 0;
      }
  }
  
  console.log(AverageWeather);
  </code></pre>
  
  <p>fiddle: <a href="https://jsfiddle.net/xd2v62rL/" rel="nofollow noreferrer">https://jsfiddle.net/xd2v62rL/</a></p>