How do we use the updateRadioOption()
what is the meaning of error message ", score = " error 4,6,7 same message
my code does updates the 3kind radio button to score = sum, displays a number sum of dice, my console logs do work
Advance thank you!
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
const getHighestDuplicates = () => {
const counts = {};
const sum = diceValuesArr.reduce((acc, el) => acc + el, 0);
diceValuesArr.forEach((num) => {
counts[num] = (counts[num] || 0) + 1;
//console.log(counts)
});
const maxCount = Math.max(...Object.values(counts));
//console.log(maxCount)
//updateRadioOption(5,0);
if (maxCount >= 4) {
updateRadioOption(0, score = sum);
//tried updateRadioOption(0, sum); also
updateRadioOption(1, score = sum);
} else if (maxCount >= 3) {
updateRadioOption(0, score = sum);
}
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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 7