Review Algorithmic Thinking by Building a Dice Game - Step 9

Tell us what’s happening:

My code does not seem to be passing the final criteria - “When updateScore(10, “hi”) is called, your new list element should have the text hi : 10.”

I’ve ran a console.log on updateScore(10, “hi”) and it does appear in a new list element on the page so I’m not certain why this step is failing. Any hints would be appreciated.

Your code so far

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

/* file: styles.css */

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

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

// 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/130.0.0.0 Safari/537.36 Edg/130.0.0.0

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 9

remove all extra spaces, add only the li element and no spaces or new lines

Ah! Just got used to adding multiple elements on different lines. Makes perfect sense. Thanks

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.