Second for loop


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-XEDZA/0/5?curriculum_id=506324b3a7dffd00020bf661#

It looks like your second 'for' loop isn't pushing values to the hits array. Make sure it's working properly and that myName's text appears somewhere in the text variable.

Replace this line with your code. 
var text="I love pizza";
var myName="Bob Smith";
var hits=[];
for(var i=0;i<text.length; i++){
    if(text[i]===myName[0]){
     for(var j=i;j<i+myName.length; j++){
         hits.push(text[j]);
         
         }   
        }
    
    }


#2

@flindip
Change your

into
var text="Bob Smith, I love pizza; Bob Smith does not";

and
add a console.log()
like

console.log( hits );

#3

Thank you did the previous exercise specify that I needed to text that related to myName. I don't believe it did. Oversight perhaps?


#4

My bad. It did. Oversight on my part...