Second "for" loop - again


#1

Hi there, I'm getting the 'does not push" message. Struggling to see where I'm going wrong so I defer to your greater minds - please can anyone tell me where I am going wrong? Thank you for your time.

var text = "jolly good show this morning Richard\
ridiculous rain Richard we are ravishing";
var myName = "Richard";
var hits = [];

for (var i = 0; i < text.length; i++); {
    if (text[i] === 'R') {
    for(var j = i; j < myName.length + i; j++);{
    hits.push(text[j]);
    }}}


#2

Hi these lines just remove the ; at the end

for (var i = 0; i < text.length; i++); <-- 
for(var j = i; j < myName.length + i; j++); <--

you can read more about it here


#3

Thank you wizmarco - I was sure I had used them in previous exercises without issues. Will read the post in more detail now.


#4

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