I keep getting a syntax error help!


#1



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


my syntax isnt working
SyntaxError: Unexpected token {


/*jshint multistr:true */
var text = "harrison is an utter beast like a cow, harrison can eat 10 mod pizzas in 20 seconds"
var myName = "harrison"
var hits =[]
for(var i = 0; i < text.length; i++)
{
    if (text[i] === "h")
    {
        for(var h = i; h < i + myName.length; h++)
        {
           if (text[i]
           {
            hits.push(text[h]);
           };
        };
    };
};


#2

@linkfire3,
A condition is Always encapsulated in a pair of parenthesis-()....
and you are writing the code line

if (text[i]

but you have to change your

if (text[i]
           {
            hits.push(text[h]);
           };

into

            hits.push(text[h]);

and therewith getting rid of the unnecessary IF statement