Tell us what’s happening:
My code seems to work correctly when I test it, but the course platform doesn’t accept it. Has anyone experienced this or knows what might be the issue?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const resetRadioOption = () => {
scoreInputs.forEach((input, i) => {
input.disabled = true;
input.value = "";
scoreSpans[i].textContent = "";
});
}
const getHighestDuplicates = arr => {
resetRadioOption()
let counts = {};
arr.forEach((item) => {
counts[item] = (counts[item] || 0) + 1;
})
for(let value in counts) {
if(counts[value] >= 4) {
updateRadioOption(1, value * counts[value]);
updateRadioOption(0, value * counts[value]);
} else if(counts[value] >= 3) {
updateRadioOption(0, value * counts[value]);
} 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(diceValuesArr);
}
});
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 7