7. Victory - codeacademy passed me but i dont understand where i went wrong


#1

I passed but my logs arent showing me the answer I want. it seems to be just feeding whatever was in my text.

Could someone please advise on what I did wrong. Attached below is my code:


#2

@kongyy,
As you are using a semi-colon-; directly after your FOR-loop setup,
and the semi-colon-; is an End-of-Statement indicator to the Javascript Interpreter,
the code-block

{
    hits.push([text[j]);
}

is NOT seen as an integral part of the FOR-loop, but is a code-block on its own.......


#3

@leonhard.wettengmx.n

Thanks for the response. I was able to properly get the result i wanted.

One additional question i got was why are you pushing the following line twice? This one says push is not defined.

{
hits.push(push[text[j]);
}

The example provided produced the same result with the code below.
{
hits.push(text[j]);
}


#4

@kongyy,
You are right, my error....
Updated my Post
so sorry !!


#5

No problem, thanks for your help!