Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
¿Por qué esta declaración if no puede hacer 2 cosas?

Estoy tratando de actualizar el contador y usarlo para poder cambiar la pregunta cada vez, pero solo funciona si elimino el contador +=1, ¡ayuda, por favor!

Código a continuación:

 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] }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!