I’m stuck in the step #9 of Review Algorithmic thinking by Building a dice game. This is my code so far
const updateScore = (selectedValue, achieved) => {
totalScore += parseInt(selectedValue);
totalScore.textContent = totalScore;
scoreHistory.innerHTML += <li>${achieved}: ${selectedValue}</li>
;
};
but it keeps telling me that I have an error cause “Your updateScore function should convert string value to integer and add the value to the total score.” I tried everything. Please help me
Your code so far
/* file: script.js */
// User Editable Region
const updateScore = (selectedValue, achieved) => {
totalScore += parseInt(selectedValue);
totalScore.textContent = totalScore;
scoreHistory.innerHTML += `<li>${achieved}: ${selectedValue}</li>`;
};
// 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
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 9