5/7 How to solve it?


#1

var text = "Hello, Asen how are u today, Asen. I love u Asen"
var myName = "Asen"
var hits=[]

for (i=0; i if(text[i] === "A"{
for(j=i; i < (text.length); i++){
hits.push(text[j]);
}
}
} // What's The problem here ?


#2

you can't do this:

for (i=0; i    if(text[i] === "A{

for several reasons, a for loop has 3 sections like you did on the for loop below. then the if statement should be in the curly brackets, if you don't remember, look up syntax for for loop