Review Algorithmic Thinking by Building a Dice Game - Step 7

Tell us what’s happening:

I have gone through a lot of people submission trying to figure out what I am doing wrong but I am not sure

Your code so far

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

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

const getHighestDuplicates = () => {
  const countMap = diceValuesArr.reduce((map, val) => {
    map[val] = (map[val] || 0) + 1;
    return map;
  }, {});
  const counts = Object.values(countMap)

  const totalSum = diceValuesArr.reduce((a, b) => a + b, 0);

  const hasFourOfAKind = counts.some(count => count >= 4);
  const hasThreeOfAKind = counts.some(count => count >= 3);

  if (hasFourOfAKind) {
    updateRadioOption(1, totalSum);
  } else if (hasThreeOfAKind) {
    updateRadioOption(0, totalSum);
  } else {
    updateRadioOption(5, 0);
  }
};


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
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 7

is this supposed to be elseif? (if the cards have 4 of a kind then they also have 3 of a kind so the 3 of a kind should be updated in the case of 4 of a kind?)

Also I noticed that you ignored this parameter requirement:

To calculate this, create a getHighestDuplicates function which takes an array of numbers.