Your second 'loop'


#1


lesson 5 your second loop

for somereason i cant find out what i am doing wrong can anyone help i know it is a syntax error, but i dont see it.

var text= "hey everyone my name is silder and i wanna show you just what a silder cane do because silder is a strong individual that doesn't need a silder.";
var myName= "silder";
    var hits = [];
       for(var i = 0; i < text.length; i++) {
	if (text[i] === "S") {
        for(var i = 0; i< text.length; i++){
    	    for(var j = i; j < (myName.length + i); j++) {
			hits.push(text[j]);
		}
	}
}


#2

Your second "Loop"

I see three loops.
Remove the first loop after your if.

And it should work


#3

Thanks it did work after that


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.