What is it you're trying to do? Basically, you get an array that has 0 to 7 elements, and loop through it. He's simple code that walks through the history and totals the steps.
var activityHistory = Act.getHistory();
var histDays=activityHistory.size();
stepHistory=0;
for(var i=0;i<histDays;i++) {
stepHistory=stepHistory+activityHistory.steps;
}
[/code]