Tell us what’s happening:
I’ve almost got it but there is a typo or wrong } or something. Help and the last part is baffling me. I thought I did update it
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
const getHighestDuplicates = array => {
let duplicates = {};
array.forEach(number => {
duplicates[number] = (duplicates[number] || 0) + 1;
});
let maxCount = 0;
let maxDuplicate
let sum = array.reduce((sum, value) => sum + value, 0)
for (const [duplicate, count] of Object.entries(duplicates)){
if (count > maxCount) {
maxCount = count;
maxDuplicate = duplicate;
};
}
if (maxCount > 3) {
updateRadioOption(1, sum)
}
if (maxCount > 2) {
updateRadioOption(0, sum)
}
if (maxCount < 3){
}
if (maxCount < 3){
updateRadioOption.textContent = `, score = 0`
}
};
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
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 7