Second for loop


#1

var text = "Matija je zapel sa js!";
var myName = ("Matija");
var hits = [];
for(var i=0; i> text.length; i++)
{
if(text[i] === 'M')
{
for(var j = i; j < i + myName.length; j++)
{

        hits.push(text[j]);

        }
    };
}

what's wrong with code?
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.


#3

for(var i=0; i< text.length; i++)
i found problem