Review Algorithmic Thinking by Building a Dice Game - Step 9

Tell us what’s happening:

So my current code is “correct” but I keep getting this message on console and it feels like Im missing something i cant see?
When updateScore(10, “hi”) is called, your new list element should have the text hi: 10.
edit: ive tried other resolutions like document.createElement(‘li’) to see if this was the issue but nothing changes

My code so far

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

const updateScore = (selectedValue, achieved) => {
  score += selectedValue
  totalScore.textContent = `${score}`;
  scoreHistory.innerHTML += `<li>${achieved}: ${selectedValue}</li>`
}
updateScore(10, "hi")

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 9

Dont update totalScore. Use score instead.

1 Like

im sorry but i have no idea what you mean? because if i dont update totalScore then my console literally tells me to update it:

Your updateScore function should update the text of the totalScore element.

So sorry. You need a space to the left of the colon.

fyi: there’s a bug in the hint. So I opened an issue for it

ahahhaha well, at least it was a silly mistake. thanks for the help

1 Like