Review Algorithmic Thinking by Building a Dice Game - Step 7

Tell us what’s happening:

My code fulfills the required functionality, produces the correct results and works without any errors. Yet my code does not pass. What do I need to do in order to pass?

Your code so far

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

/* file: styles.css */

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

const getHighestDuplicates = (arr) => {
  for(let i=0; i<scoreInputs.length; i++){
    scoreInputs[i].disabled = true;
    scoreSpans[i].textContent = "";
  }

  total = 0;
  let counter = {};
  for(let i=0; i<arr.length; i++){
    if(counter[arr[i]]){
      counter[arr[i]]++;
    } else {
      counter[arr[i]] = 1;
    }
  }
  console.log(counter);
  for (let [key, value] of Object.entries(counter)) {
    total += Number(key) * value;
  }
  let max = 0;
  for (let [key, value] of Object.entries(counter)) {
    if(value === 3) {
      max = 3;
      continue;
    } else if (value === 4) {
      max = 4;
    }
  }
  if(max === 3){
    updateRadioOption(0, total);
  } else if(max === 4){
    updateRadioOption(1, total);
  } else {
    total = 0;
    updateRadioOption(5, total);
  }
} 

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

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

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 7

Do you get an error or hint feedback?

The hint feedback is:
" When the array has four of the same number, your getHighestDuplicates function should also update the Three of a Kind radio option with , score = and the total sum of the dice."
Which is contrary, because my program fulfills this requirement.

what happens if max is 4?
(does the hint tell us anything?)

Your code says that when max is 4 only one radio button is to be updated (the four-of-a-kind)? But the hint says ???

Also please note that this step also wants you to update the 5th radio button all the time (it’s not made clear but that is the case), regardless of the roll duplicates found.