I am currently iterating through 3 arrays, searching for 'actionTimings' in each array and summing up the values of actionTimings (which are all numbers). How can I store these 3 values in a new array? This is what I have tried so far...
$.each(dinnerComponents, function(intIndex, component) {
totalCookTime = 0;
for ( var i = 0; i < component.actionTimings.length; i++ ) {
totalCookTime += component.actionTimings[i];
}
});
I attempted to do this:
totalCookTime = new Array(totalCookTime);
However, this array contains sets of commas. It seems like the number of commas equals totalCookTime-1. Is this due to the values being comma separated within the array? My understanding of arrays is somewhat limited, unfortunately.
Thank you for any assistance.