I'm trying to update the counter and use it so I can switch the question each time but it only works if i remove the counter +=1, help please!
Code below:
const questions= [
"What is Orochimaru's last name?",
"What is Sasuke's least favorite food?",
"What was Itachi's girlfriend's name?"
]
const correctAnswers= ["None", "sweets", "Izumi"]
const counter= 0 //for keeping track of answer alignment
//const score= 0 //keeps track how many they get right
submitButton.onclick= function(){
if (answer_a.checked == true && labelA.textContent == correctAnswers[counter]) {
counter +=1 //will work if I delete counter+=1 and replace counter as 1
questionContainer.innerHTML = questions[counter]
}