Looked in some posts still cant find problem


#1

Still cant find solution. Thanks for help.


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


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++)
                {
                    hits.push(text[j]);
                };
        };
    };


#2

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


#4

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)