5. Your second "for" loop


#1


5. Your second "for" loop


It says: SyntaxError: Unexpected token [


/*jshint multistr:true */
var text = "bla bla bla bla bla bla Michael bla bla bla bl/ Michael"
var myName = "Michael";
var hits = [];

for (var i=0; i < text.length; i++) {
    if(text[i] === "M"){
        for (var j = i; j < (myName.length + i); j++){
            hits.push(text.[M])
        }
    }
}


#2

you have . between text and [M] and i am not sure why you use M instead of j


#3

2 posts were split to a new topic: 5. your second for loop


#5

Thanks, that was my problem


#6