I am currently trying to do this exercise (link above) and can not figure our what the problem is with my code. I want it to run through the ‘input’ variable and the ‘vowels’ variable and console.log() any letters that are the same (all of the vowels), but it is not working and I cannot figure our why.
Any help would be greatly appreciated
Thank you
let input = 'turpentine';
const vowels = ['a', 'e', 'i', 'o', 'u']
let resultArray = []
let j = 0;
let i = 0;
while (i < input.length){
while (j < vowels.length){
if (input[i] === vowels[j]){
console.log(input[i])
} else {
console.log(`The letter ${input[i]} is NOT a vowel`)
}
j++
}
i++
}