Review Algorithmic Thinking by Building a Dice Game - Step 9

Tell us what’s happening:

I managed to figure this out after wasting over an hour with ${selectedValue} and ${achieved} thinking these would be defined later. The instructions seem to heavily imply that value and id are the parameters. But no, it just wasn’t working because I needed to use selectedValue and achieved as the parameters, or insert the text ${value} and ${id}. Is this a typo? or is there a way to do this using value/id parameters with <Li> used in the instructions?

Your code so far

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

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

const updateScore = (value, id) => {
 
   score += parseInt(value);
   totalScoreElement.textContent = score;
   scoreHistory.innerHTML = `<li>${achieved} : ${selectedValue}</li>`
}

// 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

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 9

I agree, the sentence is very clear and the way value is highlighted makes it seem like that will be the name of the parameter.

The first parameter will be passed the value of the radio button,

It has to be inferred later what they will be called when writing the score history. Might as well be explicit about the naming of the parameters, it’s complicated enough wording.

EDIT: Ok I see the way the wording “first parameter will be passed” instead of “the first parameter passed will be” is the difference but it’s very easy to misinterpret. Could be more clear.

I would suggest submitting this to github issues but you would need a very clear way to explain the values passed and the names of the parameters.

since you can use parameters of value/id with the HTML being updated with ${value} and ${id} it seems like the instruction “add a new li element to the score history ul element, using the format ${achieved} : ${selectedValue} for the li element content.” is just there to confuse, since achieved and selectedValue aren’t anything previously defined, and as far as I know won’t be able to be used outside of this function. I guess i’ll see if they’re brought up later (this really annoyed me and I needed to take a break lol). Also its not a ul element, its an ol.