5. Your second "for" loop


SyntaxError: Unexpected identifier
Can anyone tell me what I did wrong?

/*jshint multistr:true */

var text = "Hey my name is Breana\
Breana is a name. I love the name Breana\
How are you, Breana?";

var myName= "Breana";

var hits=[];

for (var i = 0; i < text.length; i++) {
if( text[i] === 'B') {
for(var j = i; j < (myName.length + i) j++) {


"The only error is your life" !?
"learn it mate" !??

This is a place where we come for the reason to learn, so if you can help then please help and don't insult people or just tell them to "learn it".

I also did wrong in this one and I expect someone to show me how to solve it, not to tell me to "learn it mate".


Funny, after "j < (myName.length + i)" should be a semicolon. learn it mate.


Yes, that is why I am here. Thank you.


Thank you very much, Ivan. :smile:


Breana or Ivan, do either of you know what's wrong with mine?

var text = "I,Letitia, love eating chocolate. My name is Letitia.";

var myName = "Letitia";
var hits = [];
for (var i = 0; i < text.length; i++){

if (text[0] ==='L'){
     for (var j = i; j < (myName.length + i); j++){


Maybe your if statement.

If(text[i] === 'L') {

I hope it helps


Thank you so much! It worked!