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

195
Views
¿Por qué no hay preguntas emergentes que escribí? Simplemente vaya a la alerta ("Respuesta correcta total: "+ puntaje); directamente

No puedo mostrar las preguntas emergentes que escribí, pero vaya directamente a la alerta (respuesta correcta total). Lo escribí siguiendo el video tutorial. ¿Alguien puede ayudarme? ¡¡¡Gracias!!!

 var questions = [ { prompt:"What is the color of banana?\n(a)red\n(b)green\n(c)yellow", // \n = 換行answer:"c" }, { prompt:"What is the color of strawberry?\n(a)red\n(b)green\n(c)yellow", answer:"a" }, { prompt:"how many centimeters is equal to One meter?\n(a)1\n(b)10\n(c)100", answer:"c" } ] var score = 0; for(var i=0; i<questions.lengths; i++){ var input=prompt(questions[i].prompt); if(input==questions[i].answer){ score++; alert("Answer Correct!"); } else{ alert("Answer Wrong!"); } } alert("Total correct answer: "+ score );
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

questions.lengths debe ser questions.length . Puede leer más sobre cómo obtener la longitud de una matriz en Javascript aquí

 var questions = [ { prompt:"What is the color of banana?\n(a)red\n(b)green\n(c)yellow", // \n = 換行answer:"c" }, { prompt:"What is the color of strawberry?\n(a)red\n(b)green\n(c)yellow", answer:"a" }, { prompt:"how many centimeters is equal to One meter?\n(a)1\n(b)10\n(c)100", answer:"c" } ] var score = 0; for(var i=0; i<questions.length; i++){ // This is the line which was incorrect var input=prompt(questions[i].prompt); if(input==questions[i].answer){ score++; alert("Answer Correct!"); } else{ alert("Answer Wrong!"); } } alert("Total correct answer: "+ score );

about 4 years ago · Juan Pablo Isaza Report

0

Tienes un error tipográfico:

 for(var i=0; i<questions.length; i++){

length - no longitudes

about 4 years ago · Juan Pablo Isaza Report
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!