Review Algorithmic Thinking by Building a Dice Game - Step 10

Tell us what’s happening:

The console gives me error even though my code is working as intended.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

keepScoreBtn.addEventListener('click', () => {
  const selectedInput = document.querySelector('#score-options input:checked');
  
  if (selectedInput) {

    const achievementLabel = selectedInput.parentElement.textContent.split(',')[0].trim();

    updateScore(selectedInput.value, achievementLabel);
    
    rolls = 0;
    round++;
    resetRadioOptions();
    updateStats();
  } else {
    alert('Please select a scoring option');
  }
});

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 10

Welcome to the forum @Amine-Hbaiz

To help you debug, you can console log the following variable:

Happy coding

Thank you for warm welcome.

my console gives this:

When your keepScoreBtn is clicked, the score history should be updated.

and I’m already updating by calling
updateScore(selectedInput.value, achievementLabel);

Try rolling the dice and see what values are displayed in the console.