Tell us what’s happening:
I’m not passing test 2 even though the requirements of that test all work on my end:
-Should enable the fourth radio button (done)
-Set the value to 30 (done)
-Update the displayed test to , score = 30 (done)
-Leave the fifth radio button disabled (done)
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const checkForStraights = (arr) => {
const sorted = arr.sort((a,b) => a-b);
const newSort = [...new Set(sorted)];
const strArr = String(newSort);
console.log(strArr)
if (strArr === "1,2,3,4,5" || strArr === "2,3,4,5,6") {
updateRadioOption(3, 30)
updateRadioOption(4, 40);
}
else if (strArr === "1,2,3,4" || strArr === "2,3,4,5" || strArr === "3,4,5,6") {
updateRadioOption(3, 30);
scoreInputs[4].disabled = true;
}
else {
scoreInputs[3].disabled = true
scoreInputs[4].disabled = true;
}
updateRadioOption(5, 0);
}
rollDiceBtn.addEventListener("click", () => {
if (rolls === 3) {
alert("You have made three rolls this round. Please select a score.");
} else {
rolls++;
resetRadioOptions();
rollDice();
updateStats();
getHighestDuplicates(diceValuesArr);
detectFullHouse(diceValuesArr);
checkForStraights(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/140.0.0.0 Safari/537.36
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 14