Problem with syntax


Oops, try again. There was a problem with your syntax.

var text = "jfasdlfj jack ajdskl \
var myName = "jack";
var hits = []
for (i = 0, i < text.length, i ++); {
             if (text[i] === "j"){
                     for(var i = j, i < i + myName.length, i++);


Should be j < .... The semi-colon at the end should not be there.

This will only push the index of the first letter. It should be the letter at index j.

This line does not belong.


I agree with @mtf

But you are also supposed to use semi-colons ; rather than commas inside your for statements parenthesis.


I take it you mean instead of commas?


Haha, quite possibly :grin:


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