Need Help with "6.log it"


I have no idea why my code is not correct; I can't see it!

Please help me out!

I'm getting something like this:
[ 'B',
' '

text = "Blah Blah Blah Chinh\
Blah Blah Blah Blah Chinh Blah\
Blah Blah Blah Chinh";

var myName = "Chinh";
var hits = [];

for (var i=0; i<text.length; i++) {
    if (text[i] === "C");
    for (var j = i; j < (myName.length + i); j++) {

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


HI your if statement you didn't open and close it

if (text[i] === "C");

and remove the ;

if (condition) {



Hey wizmarco, thank you so much for responding!

After closing the if statement, the issue remained, but I found the real culprit:

the semicolon ";"

After I removed it, the code worked perfectly!


hey, the output of the code for me was
it says it is correct, but i don't understand why, please explain


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