I am having trouble on the whale talk project on Javascript. It’s about loops. My code is supposed to display random letters between a,e,i,o,u inside the bracket when I Run it. I even went through the Project Walkthrough, did it 2 times again and again. the following code is :
const input = "Hi, My name is Wally the Whale";
const vowels = ["a", "e", "i", "o", "u"];
let resultArray = [ ];
for (let inputIndex = 0; inputIndex < input.length; inputIndex++){
//console.log("inputIndex = " + input[inputIndex]);
for(let vowel = 0; vowel < vowels.length; vowel++){
if (input[inputIndex] === vowels[vowel]){
if (input[inputIndex] === 'e'){
result.Array.push('ee');
}
else if(input[inputIndex] === 'u'){
resultArray.push('uu')
}
else{
resultArray.push(input[inputIndex]);
}
}
}
}
console.log(resultArray);