I'm looping through 3 arrays, finding 'actionTimings' in each array and adding up the actionTimings values (values are all numbers). How would I assign the 3 values I obtain to a new array? Here's what I have so far...
$.each(dinnerComponents, function(intIndex, component) {
totalCookTime = 0;
for ( var i = 0; i < component.actionTimings.length; i++ ) {
totalCookTime += component.actionTimings[i];
}
});
I tried this:
totalCookTime = new Array(totalCookTime);
But this array contains 3 sets of an amount of commas (,). Seems like the number of commas = totalCookTime-1. Something to do with values being comma separated? My knowledge of arrays is a little limited I'm afraid.
Thanks for any help.