Tell us what’s happening:
how do solve this so far so far i have my button ,the loop that generates random number ,can someone help please and explain it to me
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
//here is where the problem is ,right below
rollDiceBtn.addEventListener("click", () => {
diceValuesArr = [1,2,3,4,5,];
for (let i = 0; i < 5; i++) {
const randomDice = (Math.floor(Math.random() * 6) + 1);
diceValueArr.push(randomDice);
}
listOfAllDice.forEach((die, index) => {die.textContent = diceValuesArr[index]
})
// 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/137.0.0.0 Safari/537.36 Edg/137.0.0.0
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 3