The first thing I will mention is that all words have vowels (OK, I’m sure you can find a few unique exceptions, but you get my point), so this statement doesn’t make sense. Remember, you are not looking for words without vowels, you are looking for words that begin with a vowel. The second bullet point in the instructions say just that:
If a word begins with a vowel, just add “way” at the end.
So my hint would be to look at your regex at the beginning. What is it currently searching for? How do you need to modify it so that it searches for what I just mentioned?
It’s not incorrect, read the bullet point very carefully:
If a word begins with a consonant, take the first consonant or consonant cluster, move it to the end of the word, and add “ay” to it.
That’s all that matters. What you do if that is the case is a different story, then yes you may be moving more than just the first letter. But the point is that the decision on how you should handle this is based entirely upon the first letter.
And as I mentioned above, I would suggest you handle the first letter being a vowel first since that is the easier one. Then you can concentrate all of your effort on the slightly more difficult process of moving one or more letters from the front to the back.
Ok I got it. I was incorrectly using (vowels === 1) . The search() method returns a -1 if no match is found so I should have had (vowels === -1) when I was attempting to add the extra if statement. @jsdisco kind of led me to check that.