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

257
Views
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
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!