Tell us what’s happening:
I think Ive done everything correct, can you guys help to find the problem
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const getHighestDuplicates = (arr) => {
const counts = {};
let totalScore = 0;
diceValuesArr.forEach(num => {
counts[num] = (counts[num] || 0) + 1;
totalScore += num;
})
const maxCount = Math.max(...Object.values(counts));
if(maxCount >= 4) {
updateRadioOption(1, totalScore);
updateRadioOption(0, totalScore);
}
else if (maxCount >= 3) {
updateRadioOption(0, totalScore);
}
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
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.1 Safari/605.1.15
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 7