Second "for" loop


#1

I need some help with this section


#2

Try putting a parenthesis around "i+myName.length" the computer only sees "j < i" and then it's throwing an error because it has no idea what " + " is doing out in the open.


#3

It shows the same error.


#4

Can you post your updated code for me?


#5

Actually I got it. On my first "for" loop I was using i > text.length instead of i < text.length. Thanks for the help.


#6

im also stucked here


#7

post the code here
i
was dedbugging from morning


#8

i got the solutions try this it works
/*jshint multistr:true */
var text="yateesh Hey, how are you \
doing? My name is yateesh.";
var myName ="yateesh"
var hits =[]
for(var i=0;i for(var j=i;j<(myName.length+i);j++){ if(myName[j]===text[j])
hits.push(text[j])

                                    }

}
console.log(hits);


#9

var text = "Hey kiran, how are you \
doing kiran? My name is kumar.";
var myName = "kiran";
var hits = [];
for (var i=0; i if(text[i]===myName[0]){
for (var j=i; j<(i+myName.length); j++){
console.log(hits.push(myName[j]));
}
}
}