Created
October 22, 2021 10:40
-
-
Save Cst2989/25611b13995b63975615983ffa6f8351 to your computer and use it in GitHub Desktop.
total score
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const totalScore = (scoreCard, frames) => { | |
let score = 0; | |
scoreCard.forEach((roundScore, index) => { | |
if(roundScore === '/') { | |
score += 10 + frames[index + 1][0]; | |
} else { | |
score += parseInt(roundScore) | |
} | |
}) | |
return score | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment