Looked in some posts still cant find problem


Still cant find solution. Thanks for help.


Oops, try again. It looks like your second 'for' loop isn't pushing values to the hits array. Make sure it's working properly and that myName's text appears somewhere in the text variable.

/*jshint multistr:true */
var text = "Lorem ipsum Radek Lorem ipsum?";
var myName = "Radek";
var hits = [];

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


deleted semi-colon works fine!
Just beginning my story with coding and its gets me furious :smiley:


In case you were wondering why this semicolon did strange things, you might have a look at this:

(about conditions but it's analog for loops)