6. Log it!


#1

/*jshint multistr:true */
var text="Hello, my name is Larisa Garmo.";
var myName= "Larisa Garmo";
var hits=[];
for (var i = 0; i < text.length; i++){

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

hits.push(text[j]);

}
}
}

if(/*hits.length is 0*/) {
console.log("Your name wasn't found!");
}
else {
console.log(hits);
}

I keep receiving this message "Oops, try again. There was a problem with your syntax. " can someone helo me find my mistakes? Thank you.


#2

Hi this line

if(/*hits.length is 0*/)

you should put hits.length is equale to 0 where you put /*hits.length is 0*/


#3

Your code should reflect what is between the /*...*/. Don't copy that exactly.
hits.length === 0


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.