3. Your first "for" loop


#1

Hi. I don't really get what I'm supposed to do. Also I'm Icelandic so if you're gonna go into much detail when explaining what I'm doing wrong try to keep that in mind that I probably won't understand everything. But nevertheless, here's my code.

var myName = "Thorlindur";
var hits = [];
var nameLength = myName.length
for(var i = 0; i < condition; i++){

}

These are my ERROR messages.
ReferenceError: condition is not defined
and
Oops, try again. Does your 'for' loop iterate until it hits text.length? Check the Hint if you need help!


#2

Hi here

1 Oops, try again. Does your 'for' loop iterate until it hits text.length? Check the Hint if you need help!

You should have variable text in which you put a string with your name. Like that

var text = " Hello my name is Thorlindur"

2 for loop

for(var i = 0; i < condition; i++){

instead of condition you should put text.length like that

for(var i = 0; i < text.length ; i++){

#3

Thank you. That really helped :smiley: