Tell us what’s happening:
My code is not working no errors in the console and the output is as expected
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const getHighestDuplicates = (arr) => {
const hash = {};
arr.forEach(num => {
hash[num] = (hash[num] || 0) + 1;
})
let max = 0;
for(let i = 0; i < Object.values(hash).length; i++) {
if(Object.values(hash)[i] > max) {
max = Object.values(hash)[i];
}
}
if(max >= 4) {
updateRadioOption(1, diceValuesArr.reduce((acc, cur) => {
return acc + cur;
}, 0));
}
if(max >= 3) {
updateRadioOption(0, diceValuesArr.reduce((acc, cur) => {
return acc + cur;
}, 0));
}
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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 7