Push values to hits array 5/7


#1

Hi could someone help me out, this is my text and I dont see what the problem is? It says the second for loop isnt pushing values to the hits array???
var myName="Marius"
var hits=[]
for (var i=0; i<
text.length; i++
){if (text[0]==="M")
{for(var j=i; j<
myName.length+i,j++)
{hits.push(text[j]);
}
}
}


#2

var myName="Marius"
var hits=[]
for (var i=0; i<
text.length; i++
){if (text[0]==="M") //replace text[0] with text[i]
{for(var j=i; j<
myName.length+i,j++) //replace comma with semi-colon
{hits.push(text[j]);
}
}
}
//add console.log()
console.log( hits );