Hello, I am on Step 10, of the Whale Project and all I produced was an empty pair of brackets! i.e. empty Array. The statement says that if there’s and E or a U in the Array, input[inputIndex] and then it’s supposed to return a double E , or a double U… Please can you help?
Hi’
Thanks for the line of code earlier. I am now engage in the debugging process…
I believe it is the If statement that’s the problem… because its only supposed to return, the input array that is equal to the vowles array, but that first if statement is returning a continuous string of all the vowles. How do I get the result, that I want?
when you apply console.log to the result array that also shows an error message… But that would be the goal. If i could actually get the If statement to return a result to the result array?
Hi’
Thanks for getting back to me. I realise there was an unnecessary .push to the result array, underneath the first If statements, So I removed that, and applied the second If statement. Still receiving error message.
Have applied the console.log at different lines to no effect!
You should take a step back and first think about how to solve this problem. I would recommend the following approach:
check if is vowel, if vowel push to results array
do another check if vowel is e or u, if so, add another one of these vowels to result array
so then you most certainly need the .push() you just removed
you still have not fixed this line:
if(input[inputIndex].toLowerCase === vowles[v2])
you are still not calling toLowerCase correctly, resulting in an incorrect comparison.
you should also indent your code properly, the error you currently have seems related to missing closing (curly) bracket. With the right indention, finding such a mistake is a lot easier
why do you have this loop twice:
for (let v2 = 0; v2 < vowles.length; v2 ++){
////its th Array inth Methd that Points.
//console.log("v is " +v2)
for (let v2 = 0; v2 < vowles.length; v2 ++){
this is the if statement, and it definitely has vowles in it…
However this statement is regarding step 8…
Inside the second for loop, write a code block that compares the input letter to every letter in the vowels array.
I have coped Step 8 in the statement above and as you can see… it is a very small sentence to complete and there is no… mention here of using .push to push the result to the result array?