I need help with the JavaScript level called search text for your name. Can someone help?


#1

/*jshint multistr:true */
var text = "JakedeuhfudhjksdhgfizJakefsfdjfjdzkJakeiefhsdjfdJake"
var myName = "Jake"
var hits = [];
for(var i = 0; i < text.length; i++){
if(text[i] === 'J') {
for(var i = 0; i < 4; i++){
hits.push('Jake')
};
}


#2

What do you need help with?


#3

you can try to type like this:
for(var i=0;i var hits=[];
if(text[i]==="J"){
for(var j=i;j hits.push(myName[j-i]);
}
console.log(hits);
}
in the nested if function,the loop variable should be another,you can name it j,instead of i


#4

please help me :(((((((:confused:


#5