OMG WTH pls help


Ok I got help from someone else but now it just crashes my browser

/*jshint multistr:true */
var text ="My name is Saihaan and that name belongs to Saihaan.";
var myName= "Saihaan";
var hits = []
for (var i = 0; i < text.length; i++)
    if (text[i] === "S")
        for(j = i; j > myName[0].length; j++)


Please read the hint:

Your loop should stop when it hits the value of the first iterator (say, i) plus the length of your myName variable.

So you need something like this:

j < i + myName.length

This code:

j > myName[0].length

checks if j is greater than one. Because myName[0] is just "S".


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