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 :)