Help needed!


#1

*jshint multistr:true */

var text=" mnsdjgeahjbfvghyuweafhegv wervg4ewtvqaw4eqa Soham,Sohamedwghtywfuyvfutyfveytf,Soham";
var myName="Soham";
var hits = [];
for(var i = 0; i < text.length; i++) {
if (text[i] === 'S') {
    console.log(myName);  {
        for (var i = j; i = i + myName.length; i++)
        hits.push(myName)
    }
}   
}

#2

Hi here

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

Its should be like that:
In the first part var i = j

var j = i

And the second part i = i + myName.length

 J < i + myName.length

And the third part i++

 J++

And inside the hits.push("here") Its should be like that

hits.push(text[j])

So all your cose should be like that

Spoiler Warning

for (var j= i;  j <  i + myName.length; j++)
hits.push(text[i])