Second Loop hits.push does not work


#1

I got some troubles with this excersice,

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 = "this is a text damian damian damian";
var myName = "damian";
var hits = [];

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

#2

@damian.olguin,
-1
You will want to check the 1st character of your name
and as the count starts from zero
you would have to use
myName[0]
-2
Try it by push-ing a character from the text

hits.push(text[j]);

#3

I found my error, I didn't realize abut the first for is falling the condition from the first time the correct statement is:

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

thanks anyway