Not sure why I have an extra “E” in my output ??
const input = 'a whale of a deal!';
const vowels = ['a', 'e', 'i', 'o', 'u'];
let resultArray = [];
for (let i = 0; i < input.length; i++) {
// console.log('i is '+ i);
for (let vowel = 0; vowel < vowels.length; vowel++) {
// console.log('x is '+ x);
if (input[i] === vowels[vowel]) {
if (input[i] === 'e') {
resultArray.push('ee');
}
if (input[i] === 'u') {
resultArray.push('uu');
} else {
resultArray.push(input[i])
}
}
}
}
console.log(resultArray.join('').toUpperCase());