for (var i = 0, sum = 0; i < output.length; sum += output[i++]); console.log(sum); /* * Outputs: 39 */