Tell us what’s happening:
The code does whats supposed to do: It updates the score, the score history and resets the radio buttons.
But still, it gaves me this console error: “3. When your keepScoreBtn is clicked, the score history should be updated.”
I need help please
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
keepScoreBtn.addEventListener("click",()=>{
const scoreInputsArr = Array.from(scoreInputs);
if(!scoreInputsArr.some((input)=>input.checked)){
alert("Please select a score option before proceeding.");
return;
}
const checkedIndex = scoreInputsArr.findIndex((input) => input.checked);
const selectedValue = scoreInputsArr[checkedIndex].value;
const achievables = [
"Three of a kind",
"Four of a kind",
"Full house",
"Small straight",
"Large straight",
"None of the above",
];
const achievedLabel = achievables[checkedIndex];
updateScore(selectedValue, achievedLabel);
resetRadioOptions();
round++;
rolls = 0;
});
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 10