I am unable to get past Step 10 where it wants me to write the ‘if’ statement to look at ‘e’ and send to resultArray with .push(). But it is not letting me due to errors and it doesn’t seem to be right. Here is my code and here is the error.
//What will be translated.
let input = “The only thing they fear is you.”;
//Vowel Array
const vowels = [“a”, “e”, “i”, “o”, “u”];
//Where to store the vowels
let resultArray = ;
//Loop to iterate ‘input’
for (let i = 0; i < input.length; i++) {
if (input[i] === “e”) {
resultArray.push(input[i]);
}
for (let v = 0; v < vowels.length; v++) {
if (input[i] === vowels[v]) {
resultArray = vowels[v];
}
}
[//console.log](https://console.log/)(i)
}
I searched and searched and the reason seems to be that it cannot push to something that isn’t an array. But resultArray is an array. I tested earlier and things were ending up in the array but it just won’t push the entries. Can anyone assist?
I changed the resultArray = vowels[v] into push and it fixed it. You were right. It was changed to a string and the push was never going to work if this was a turn into a string. Thanks for the help!