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

285
Views
¿Puedo usar algo similar en el conmutador con node.js?

¿Puedo usar algo similar en el conmutador con node.js?

 let = "aggsfg"; if (s[0] == "a" || s[0] == "e" || s[0] == "i" || s[0] == "o" || s[0] == "u") { console.log("vogais"); } else if (s[0] == "b" || s[0] == "c" || s[0] == "d" || s[0] == "f" || s[0] == "g") { console.log("consoantes1"); }
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

let s = "aggsfg"; if ('aeiou'.includes(s[0].toLowerCase())) { console.log("vogais"); } else if ('bcdfghjklmnpqrstvwxyz'.includes(s[0].toLowerCase())) { console.log("consoantes1"); }

Tuviste un error al declarar la variable s.

over 4 years ago · Santiago Trujillo Report

0

El nodo tiene una declaración de cambio. Ver aquí

over 4 years ago · Santiago Trujillo Report

0

Todavía puede comprimir su código usando if e includes . Pero así es como puedes hacerlo con el switch

 let s = "aggsfg"; switch(s[0]) { case "a" || "e" || "i" || "o" || "u": console.log("vogais") case "b" || "c" || "d" || "f" || "g": console.log("consoantes1") }

over 4 years ago · Santiago Trujillo 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!