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

122
Views
usando múltiples bloques else en condicional

No estoy muy seguro de por qué mi código no funciona. ¿Alguien puede ayudar? javascript

 /*if statements below*/ if (hours > 18) { greeting = "Good Evening" } else if(hours > 12) { greeting = "Good Afternoon"; } else { greeting = "Good Morning"; } else { greeting = "Welcome Night Owl"; }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Si fuera otra escalera, debería ser como a continuación

 if (hours > 18) greeting = "Good Evening"; else if (hours > 12) greeting = "Good Afternoon"; else if (your condition missing here) greeting = "Good Morning"; else greeting = "Welcome Night Owl";

para más información consulta esta url .

about 4 years ago · Juan Pablo Isaza Report

0

Primero debe aprender sobre programación básica para javascript, le sugiero que visite https://javascript.info Debería probar esto, espero que tenga sentido

 const hours = 12; if (hours <= 18 && hours > 12) { greeting = "Good Evening" } else if(hours == 12) { greeting = "Good Afternoon" } else if(hours >= 4 && hours < 12){ greeting = "Good Morning" } else{ greeting = "Welcome Night Owl" } console.log(greeting);
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!