Tell us what’s happening:
My code passes successfully, but I don’t understand why. If “selectedValue” refers to the value of the radio button, according to the HTML that should be the “value” that we see below:
<input type="radio" name="score-options" id="three-of-a-kind" value="three-of-a-kind" disabled />
But in this case, that “value” is the string “three-of-a-kind”. How is it possible that a string of purely text is being successfully parsed as an integer?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const updateScore = (selectedValue, achieved) => {
score += parseInt(selectedValue);
totalScoreElement.textContent = score;
scoreHistory.innerHTML += `<li>${achieved} : ${selectedValue}</li>`;
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:134.0) Gecko/20100101 Firefox/134.0
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 9