5/7, tried various previous topics on the second loop


#1



/*jshint multistr:true */

var text = "asdf wer asdfj asdf Nico asderfln asdfkn ag n Nico asdfijlas;df Nico askdlfn skljd f";

var myName = "Nico";

var hits = [];

for(var i = 0; i < text.length; i++);{
    if ( text[i] === "N") {
        
    for (var j = i; j < i + myName.length; j++) {
        hits.push(text[j]);
    }
    }
}

Knowing me, there is something very tiny I am missing...


#2

HI this line remove the ; at the end

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

#3

How right you are :wink:
check @wizmarco's post


#4

blargh. @nickgrimes50 nailed my comment

Thank you both!