Skip to content

Instantly share code, notes, and snippets.

@Cst2989
Created October 22, 2021 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cst2989/25611b13995b63975615983ffa6f8351 to your computer and use it in GitHub Desktop.
Save Cst2989/25611b13995b63975615983ffa6f8351 to your computer and use it in GitHub Desktop.
total score
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