Whale loop question

Hi,

When I run my code nothing is showing up on the console. I cannot figure out what I am doing wrong.

const input = 'Stressed spelled backwards is dessert';
const vowels = ['a', 'e', 'i', 'o', 'u'];
let resultArray = [];
for (let inputIndex = 0; inputIndex < inputIndex.length; inputIndex++){
console.log('inputIndex = ' + input);
}

@script0654888641 You are defining the inputIndex variable in the loop and your condition is also depending on its size. I asume you meant the length of the vowels or other variable in your condition test:
inputIndex < inputIndex.length

1 Like