Your second for loop


Please someone help i'm not sure how to fix the below issue. I'm sure its something simple that i'm not seeing?

My error message says "Oops, try again. Careful: your second 'for' loop should stop when it reaches its current point in the string + myName.length."

var text = "The story of Phillip Beltre\
is one that is very interesting.\
To be honest, Phillip is low key a G.";
var myName = "Phillip";
var hits =[];

for (var i = 0; i > text.length; i++){
    if (text[i] === "P"){
        for(var j = i; j <= myName.length; j++){


This is my code and it worked you should look through and see if you can find what you did wrong:
var text = "Aaron likes pi. Aaron also like cake. Aaron likes food in general.";
var myName = "Aaron"
var hits = [];
for (var i = 0; i < text.length;i++) {
if (text[i] === 'A'){
for (var j = i; j < (i + myName.length); j++) {


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.