6. Log it!


#1


I don't know what I did wrong.


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

Replace this line with your code. 
/*jshint multistr:true */

var text = "Yerim";
var myName = "Yerim";
var hits = [];


{for( var i = 0; i <= text.length; i++)
if (text[i]==='Y') {
    for (var j = i; j < i + myName.length; j++) {
        hits.push(text[j]);
    };
    console.log(hits);
};
}


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

} ;


#2

this line:

if (hits.length===0;) {

why is there a semi-colon in this line?

and your else clause:

else {
  // empty?
} ;

is empty, it can't be empty. see for the instructions what you need to log

please make a reply to your earlier topic that you resolved the issue.


#3

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