Looping and adding together the values generated
问题 I have just started learning javascript, and I've hit a bit of a roadblock whilst designing the logic behind a 10 pin bowling scorecard. I would be really grateful if someone could help me figure out how, instead of my messy code below for the totalScore function, I could use a for loop that will add all of the values together. The code that I have so far is as follows. Thank you in advance! function Game() { this.scorecard = [] }; Game.prototype.add = function(frame) { this.scorecard.push