Whale talk project has no output

Hi all,
I am very new to javascript and I have been stuck on this project for hours. I followed the get unstuck video and double checked it multiple times. I have also been reading through some of the difficulties that other users have had. Can anyone help me figure out why when i consol.log (resultArray). nothing seems to have been sent to the array???

Heyo,

So what looks to be the problem is you are checking if the input is equal to the vowels, but not making sure they are of the same case.
For example: input[i] === vowel[j] --> 'i' === 'I' // Returns false

I’ll offer the soloution I would recommend in a hidden tag, since I recommend you attempt to solve your problem your self before looking at my suggestion. :grinning_face_with_smiling_eyes:

Solution

Before you do any checks on the input change the case of input to be the same as volws like show:

const input = 'fish are friends not food';
const vowels = ['A', 'E', 'I', 'O', 'U'];

// Normalize the input
const inputUpper = input.toUpperCase();

// Rest of your code

Please post all your raw code, and a link to the exercise.

Thank you so much for the help! I didn’t even realize that I had completely overlooked the state of the actual characters in my array!

I decided to change all the strings in my array to lowercase and then force them to appear how I wanted when I logged the resultArray.

Thanks again!

Glad you figured it out! :tada:

Its not so important now since you know what kind of input you will get, and its a small project.
But in the future remember this, especially when taking input from users!

Input validation/sanitation is incredibly important. Can’t tell you how many times I’ve forgotten to check case on an input and its broken my logic. :sweat_smile: