Webpage doesn't respont


After I click on "Save & Submit code", webpage doesn't respond.


you have an infinity loop, that causes the page the freeze

can you copy paste your code to the forum?

What version of windows are you using?


/*jshint multistr:true */
var text = 'gskxne djwjbfhe Arkember shxnsm Arkember cjcjddn Arkember';
var myName = 'Arkember';
var hits = [];

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


your second loop:

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

check if i + something is greater then i, while increasing i. since i will increase, this condition never becomes false.


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