Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

253
Vistas
Why this two parts do not want to work together?

guys!

I tried to solve this kata and ran into a problem

https://www.codewars.com/kata/593b1909e68ff627c9000186/train/javascript

  function nicknameGenerator(name){
   if (name.length < 4) {
   test = "Error: Name too short";
   return test;
 } else if (name.length > 4 && name[3] != 'a' || 'e' || 'i' || 'o' || 'u') {
     return name.substr(0, 3); 
   }      else if (name.length > 4 && name[4] == 'a' || 'e' || 'i' || 'o' || 'u')  {
          return name.substr(0, 4);
         } 
   }

both 'else if' parts work great separately from each other. but in the general code only one works, what am I doing wrong? also, if you rearrange the part "Error: Name too short" to the end, then it will also not work :с

I'm just starting to learn so please be patient with me please :)

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda