Search Text for Your Name; Lesson 6; Unexpected Token in If/Else statement?


#1

It keeps saying that I have an unexpected token in my if/else statement, and I don't know how to fix it.
/*jshint multistr:true */
var text = "My name is Jasmyn; I love the name Jasmyn.";
var myName = "Jasmyn";
var hits = [];
for(var i = 0; i < text.length; i++){
if (text[i] === "J") {
for(var j = i; i < hits.push(myName); i + myName.length);
}}
if(/*hits.length = 0*/) {
console.log("Your name wasn't found!");
} else {
console.log(hits);
}


#2

Hi this part

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

You should remove the /* */ around hits.length = 0 and then put === instead of =


#3

Thanks, I figured it out!