Adding Iterator crashes the webpage


When I add j++ to the last for loop, the webpage crasshes. When I don't add it, the code says I'm wrong.

/*jshint multistr:true */
var text = "Shrike rhjdl;afajd;va'afojvbamld,ng;afvl;acb'a";
var myName = "Shrike";
var hits = [];
  for (var i=0; i<text.length; i++) {
      if (text[i]===myName[0]) {
          for (var j = i; j=i+myName.length; j++) {

Unexpected token ) AGAIN

the condition of your second loop:


you set j to a value of myName.length + i? that is not really a condition, j should continue to increase until it is no longer smaller then (<) i + myName.length


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