Need some help!


#1

stuck here...system say "Careful: your second 'for' loop should stop when it reaches its current point in the string + myName.length."

below it's my code.
var text = "batista,dora,momo,kenny"

var myName = "batista"

var hits =[]

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


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

= https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for
= https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push


#3

WOW.....thanks for your help.