8. When to While and When to For (Help)


#1

Hey team,

I keep running into a syntax error for my code. Would anyone be abl to take a look at it? It keeps saying that there's an unexpected string.

https://www.codecademy.com/courses/javascript-beginner-en-ASGIv/2/1?curriculum_id=506324b3a7dffd00020bf661

var count = 0
var loop = function () {
    while (count < 3) {
        console.log ("Sahr is the bomb!")
        count ++ ;
    }
}
loop ();

var text "the real gober is the bomb, but Sahr is truth";
var myName = "Sahr";
var hits [];
for (var i = 0; i < text.length; i ++); {
    if (text[i] === "S") {
        for (var j = i; j < (i + myName.length); j ++)
        {
            hits.push (text[j]);
        }
    }
}

#2

It's here.

you need to put an equal sign after text.

var text =

#3

Thanks bandit, you're the realest MVP!!!


#4

You're welcome :grin: