Whale Talk: console only printing []

Hi guys, I’ve been stuck on this issue for ever! I’ve read all the forums, watched the “step by step vid” but when I go to print my work all that shows up is

See code below.

const input = ‘Free Willy the whale’;
const vowels = [‘a’,‘e’,‘i’,‘o’,‘u’];
let resultArray = ;

for (let i = 0; i < input.length; i++) {
for (let j = 0; j < vowels.lenth; 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);

// prints only

Hello @dev0115261819. Have you checked the spelling of length here:

Does it look right?

1 Like

After nearly 3 hours of troubleshooting… I found the typo about 15mins ago…
Thanks @codeneutrino

2 Likes