What am I doing wrong 2nd for statement


#1


https://www.codecademy.com/en/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.


/*jshint multistr:true */

var text = "Hi, How are you\
        doing? I am Marphil."
var myName = "Marphil"
var hits = []

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


#2

in your first for loop:

for(i = 0; i > text.length; i++)

why do you use >? that doesn't make much sense, i is smaller then text.length, it should be the other way around (<), this way it will run until i becomes larger then the length of text


#3

Seriously? haha Thanks so much bro. It worked!