Whale Talk - resultArray.push() is not a function error

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”) {
for (let v = 0; v < vowels.length; v++) {
if (input[i] === vowels[v]) {
resultArray = vowels[v];


TypeError: resultArray.push is not a function

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?

The link from what I am working on - Whale-Talk Project

If you want to push to resultArray, this needs to be initialized as an empty array:
let resultArray = [];

These quote marks need to be corrected. Use either single or doble quote marks: " / '

Here you are changing the type of resultArray from an array to a string. It needs to be pushed rather than assigned as you did above.

This causes a syntax error. Needs to be removed

Interesting how almost all these things didn’t carry over when I copied them here.

  • I am using double quotes for the vowels array
  • I am not using an empty let resultArray, I actually have the empty brackets but it didn’t copy over.
  • The last console log is a comment. So it wasn’t causing syntax issues.

I’ll visit the resultArray = vowels[v] and turn it into a .push.

Appreciate the help! Thank you.

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!