5. Your Second 'For' Loop


#1



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


"Oops, try again. 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."


var text = "Hello darling. \
How are you feeling today?";
var myName = "Tuyen";
var hits = [];

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


#2

Your name does not appear in the text.