Page malfunction on code academy end


#1



I am not able to save and submit code on number 5. for some reason it isnt able to load and then it takes me to an error page. 

please help. I need to complete java script in the next week


#2

@gallo216,
Could you give us the FULL code you are using,
and mention which section/course nr.5 you are writing about,
maybe by also adding the Instructions!!!!


#3

its javaScript #5 your second "for" loop, but that is not what the problem is. My code is actually awesome. The problem is that when I submit the code, the page loads for a long time and then sends me to an error page (whole page). its not the code that is the issue, its the CA software.


#4

An infinite loop can crash the page.

So please show us your code, otherwise we can't help you.


#5

thanks for being polite.

var text = "text Michael hello there is cool stuff here Michael and its wonderful";
var myName = "Michael";
var hits = [];
for (var i = 0; i < text.length; i++); {
if (text[i] === 'M'); {
for (var j = i; j < i + myName.length; i++) {
hits.push(text[j]);
}
}


#6

HI you should remove the ; after the if and for loop condition

for (var i = 0; i < text.length; i++); <= this one 
if (text[i] === 'M');  <== this one too

#7
  1. At first remove ; after
    for (var i = 0; i < text.length; i++); <= this is
    and
    if (text[i] === 'M');<= this is
  2. Remove i++
    and add j++
    3.At last add }
    ok??
    You can ask me any question if you need.
    @gallo216