5/7 help me


#1

Hey I'm really stuck on this problem, can anyone help me?

var text = "hello my name is Molly and I am a \
student at University of Central Arkansas. My full \
name is Molly Anne Rhodes"

var myName = "Molly"

var hits = [ ]

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


#2

the for loop syntax here should be similar to the first one you wrote like this

for(var j = i; i<myName.length+i;j++){
    newArray = []
    newArray.push(myName);
    newArray[0];

but you dont need to create a new array. all you have do is

hits.push(myName);