Tell us what’s happening:
I console.log my .die element and diceValuesArr and can see the corresponding values. Am I missing something? Or did I misunderstand what the assignment?
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
rollDiceBtn.addEventListener("click", () => {
diceValuesArr = [];
listOfAllDice.forEach((die) => {
die.value = Math.floor(Math.random() * (6 - 1 + 1)) + 1;
die.setAttribute("value", die.value);
diceValuesArr.push(die.value);
console.log(diceValuesArr);
console.log(die);
return;
})})
// 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 3