Review Algorithmic Thinking by Building a Dice Game - Step 7

Tell us what’s happening:

Bonjour depuis ce matin je suis bloque ici Aidez moi c’est urgent

Your code so far

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

/* file: styles.css */

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

const getHighestDuplicates = (numbers) => {

  const countObject = {};

   numbers.forEach((number) => {
    if (countObject[number]) {
      countObject[number]++;
    } else {
      countObject[number] = 1;
    }
  });

  const sum = numbers.reduce((a, b) => a + b, 0);

  if (countObject === 4) {
    updateRadioOption(0, sum);
  } else if (countObject === 3) {
    updateRadioOption(1, sum);
  } else {
    updateRadioOption( 5,score = 0);
  }
}

rollDiceBtn.addEventListener("click", () => {
  if (rolls === 3) {
    alert("You have made three rolls this round. Please select a score.");
  } else {
    rolls++;
    rollDice();
    updateStats();
    
  }
});

// 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/127.0.0.0 Safari/537.36

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 7

If you have 4 or 5 identical rolls, then both the 4 of a kind and the 3 of a kind radio button should be updated.

If you have 3 exactly that are the same, then only the 2nd radio button should be updated.

you should loop through countObject before using conditional statement.