Use === instead of =


#1

The program is letting me continue on and says I did the coding correct but if I press Save and Submit the console just shows: [] (the brackets) as opposed to the actual text. This is my code: Help!

/*jshint multistr:true */
var text = "Goodness Gracious, Bailey! You are getting \
to be quite the interesting young fellow! Although, Bailey, I sometimes question your poor decisions, you, Mr. Bailey, always seem to figure out the solution!"
var myName="Bailey"
var hits = []
for (var i=0; i<text.length; i++) {
    if(text[i]==="B") {
        for (var j=i; j<(i+myName.length); j++) {
            hits.push(text[j])
        }
    }
}
if (hits.length=0) {
    console.log("Your name wasn't found!");
} else {
    console.log(hits);
}

#2

@datarunner73465 end ur variables properly with semicolons(:wink:.


#3

I tried that. Nothing.

Thanks for your reply.


#4

That is the problem, use === in there instead of =.

= makes something equal
=== checks to see if something is equal


#5

Victory for real this time! Thanks for catching that.


#6

srry i did't see further, once i find out it was semicolon missing....
good to hear prblm solved..