6. Log it. It says I'm missing a ) after condition. Can't seem to find it


#1


https://www.codecademy.com/courses/javascript-beginner-en-XEDZA/0/6?curriculum_id=506324b3a7dffd00020bf661#


/*jshint multistr:true */

var text = "Flash a new card plomo to play, \ then flash the other card plomo to win plomo money.";

var myName = "plomo";

var hits = [];

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


if(hits.length < 1;){
    console.log("Your name wasn't found");
} else {
    console.log(hits);
}


#2

The interpreter is seeing the illegal token ; inside the condition so is throwing an exception.


#3

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