Give a good explanation for this code please


#1

Hi there guys,
Could somebody explain to me in detail how this code works in DETAIL
lesson 5: Your second "for" loop.

Code Here:

        //My name is Peter if you need that info.
        for ( j = i; j < i + myName.length; j++ ) {
            
            hits.push(text[j]);
            
        }

Thanks for your reply and please be in depth for me too understand more of this code.
Link to subject here: https://www.codecademy.com/en/courses/javascript-beginner-en-XEDZA/0/5?curriculum_id=506324b3a7dffd00020bf661#`Preformatted text`


#2

you can read this
here is a good explanation
https://discuss.codecademy.com/t/5-your-second-for-loop-not-understanding-the-second-loop/34554/2?u=rcodeman


#3

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