Loops and Arrays II


#1

What is the error in this code?

/*jshint multistr:true */
var text=" mnsdjgeahjbfvghyuweafhegv wervg4ewtvqaw4eqa Soham,Sohamedwghtywfuyvfutyfveytf,Soham";
var myName="Soham";
for(var i = 0; i < text.length; i++) {
if (text[i] === 'S') {
console.log(myName);
for(var i = j; i + myName.length;j++) {
hits.push(text[j])

}
}
}

Oops, try again. There was a problem with your syntax.


#2

hi this part

for(var i = j; i + myName.length;j++)

you fort to put the j less than i + myName.length in your second statement

for (statement1, statement2, statement3) {

}