I have a quote long javascript int array such:
var heights = new Array(120, 123, 145, 130, 131, 139, 164, 164, 165, 88, 89);
I have to calculate the average value three items per time, including the last two numers (88, 89). How can I do a correct loop in order to incluse these last values (which are only two) ?