Review Algorithmic Thinking by Building a Dice Game - Step 7

Tell us what’s happening:

I honestly don’t know what I’m doing wrong. It looks like it’s telling me to update with radio option if something appears less than 3 times, but I believe that’s what I added into the code. Could someone help me with this?

Your code so far

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

/* file: styles.css */

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

const getHighestDuplicates = (array) => {
  let highestDuplicates = {};
  let sum = diceValuesArr.reduce((acc, el) => acc + el, 0)

  listOfAllDice.forEach(el => {
    if(highestDuplicates.hasOwnProperty(el, textContent)){
      highestDuplicates[el.textContent] ++
    } else{
      highestDuplicates[el.textContent] = 1
    }
  })

  for (let key in highestDuplicates){
    if(highestDuplicates[key] >= 3){
      updateRadioOption(0, sum)
    }
    else if (highestDuplicates[key] < 3){
      updateRadioOption(5, score)
    }
  }
}

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

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 7

you need to update the four of a kind button if 4 or more dice are the same.
you need to update the three of a kind button if 3 or more dice are the same.
you need to update the last radio button in all cases.

So you will need 2 if statements for the first 2 cases.
(note that if you have 4 of the same, both the four-of-a-kind button AND the three-of-a-kind button will be updated because 4 equal dice includes 3 equal dice)