5. Second "for" Loop


#1

I am very lost, what is going on. Please Help!

/*jshint multistr:true */
var text = "blal, blah, blah, blah, blah \
Jeremiah, Jeremiah, Jeremiah";

var myName = "Jeremiah"

var hits= []

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


#2

Hi there.

This is a common point of confusion between people who take this course.

Please refer to a previous response which I gave to someone with similar confusions. And I hope it can clear up this exercise for you.

If not let me know.


#3

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