Codecademy - Whale talk Project

Hello everyone! Here is my results for the codecademy Whale Talk project. Take a look and let me know what you think! what can I do better? What did I miss? Do you have any questions for me? Any feedback would be great. THANKS!

// Step 1
const input = 'a whale of a deal';
// Step  2
const vowels = ['a','e','i','o','u'];
// Step 3
let resultArray = [];
// Step 4
for (let inputIndex = 0; inputIndex < input.length; inputIndex++){
// Step 5 = console.log('i is ' + i);
// Step 6 - nested for loop
  for (let vowelIndex = 0; vowelIndex < vowels.length; vowelIndex++){
  // console.log('J is ' + j); // Step 7 - test code
// Step 8 - compare input letter to every letter in vowel array
    if (input[inputIndex] === vowels[vowelIndex]) {
      // Step 9 & 10 - Double 'e' & Double 'u'
      if (input[inputIndex] === 'e' || vowels[vowelIndex] === 'u') {
        resultArray.push(input[inputIndex],input[inputIndex])
      } else {
        resultArray.push(input[inputIndex])
      }
    }
  } 
}
// Step 11 & 12 - log results and join strings
console.log(resultArray.join('').toUpperCase())
// Test result to check output 
console.log('UUEEIEEAUUEE')

Giving feedback for the first time? AWESOME! Check out this video for a boost of confidence: How to Review Someone Else’s Code
Feel free to remove this message before posting.

Cheers!
—Codecademy Community Managers

1 Like

I wrote this code, and it isn’t working.
The result in the console is an empty array . I do not find the mistake:

const input = [‘Chiba shi Inage Ku’];
const vowels = [‘a’, ‘e’, ‘i’, ‘o’, ‘u’];
let resultArray = ;

for (let i = 0; i < input.length; i++) {
for (let j = 0; j < vowels.lngth; j++) {
if (input[i] === vowels[j]) {
if (input[i] === ‘e’) {
resultArray.push(‘ee’);
} else if (input[i] === ‘u’) {
resultArray.push(‘uu’);
} else {
resultArray.push(input[i])
}
}
}
}
console.log(resultArray);