Review Algorithmic Thinking by Building a Dice Game - Step 7

Tell us what’s happening:

I am lost I don’t know at all what to do. Is there some angelic person who can walk me through it? I have been stuck for days

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

const getHighestDuplicates = array => {}
const counts = {}
let totalScore = 0

rollDiceBtn.addEventListener("click", () => {
  if (rolls === 3) {
    alert("You have made three rolls this round. Please select a score.");
  } else {
    rolls++;
    rollDice();
    updateStats();
    
  }
});

// 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/130.0.0.0 Safari/537.36

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 7

forget for a moment about writing the code. Do you understand what the app should do?

yes count any number that repeats?

and use those numbers for what?

 const getHighestDuplicates = (array) => {
  let myObj = [
  {  
    "1": 0,
    "2": 0,
    "3": 0,
    "4": 0, 
    "5": 0,
    "6": 0,
    }
  ]
    for (let i=0; i< array.length; i++) { 
       myObj[0][array[i]]++;
       
        };

   let mostFrequentNumber = null; 
   let highestCount = 0;

  for (let number in myObj[0]) {
    if (myObj[0][number] > highestCount) { 
      highestCount = myObj[0][number];
      mostFrequentNumber = number;
    }
  }

 const sumofdice = array.reduce((first, second)=> first + second)

 if(highestCount >= 4){

   updateRadioOption(1, sumofdice);  

 };

 if(highestCount >= 3){

   updateRadioOption(0, sumofdice);

 };
 
 if(highestCount < 3){

   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();
  }
});

hi @trexylooke please create your own topic to ask for help

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.