Review Algorithmic Thinking by Building a Dice Game - Step 9

Tell us what’s happening:

Why is my function not passing. It keeps saying I need to update my function name which i have done.

Your code so far

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

/* file: styles.css */

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

const  updateScore = (value, id) => {
  const checked = [...scoreInputs].find(item => item.checked);
  const value = checked.value;
  const id =  checked.id;
  totalScoreElement.textContent += value;
  const li = document.createElement("li");
  li.textContent = `${id} : ${value}`;
  scoreHistory.appendChild(li);
};
updateScore(selectedValue, achieved);

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:143.0) Gecko/20100101 Firefox/143.0

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 9

value and id are already passed into the function as parameters.

…add a new li element to the score history ul element, using the format ${achieved} : ${selectedValue}

This hints at the expected parameter names for this function.

The function will need to add the user selected value to the score

Where are you doing this?

This is done with this

  totalScoreElement.textContent += value;
  const li = document.createElement("li");
  li.textContent = `${id} : ${value}`;
  scoreHistory.appendChild(li);