Your second "for" loop


#1


This is the code that is not working.


/*jshint multistr:true */
var text = "Hai what is up?"
var myName = "Fernanda";
var hits = [];
for (var i = 0; i < text.length; i++){
if(text[i] === 'F') {
}
for (var j = i; j <(myName.length + i); j++) 
{
hits.push(text[j]);
}
}
}


#3

HI you should put at least once your name inside the variable text (in the string)

var text = "Hai what is up?"

then here you close earlier the if statement remove the closing }

if(text[i] === 'F') {
} <--

#4

Thanks a bunch, I was stuck on this for a while. :slight_smile:


#5

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