 <p>I think you can iterate through the character check if that is vowel or not as below:</p> <pre><code> define a new string for(each character in input string) //("aeiou".indexOf(character) &lt;0) id one way to check if character is consonant if "aeiou" doesn't contain the character append the character in the new string </code></pre>