5, your second "for" loop


#1

Could somebody help me with this code ?

thx

/*jshint multistr:true */
var text ="Joe";
var myName = "kantiphasto";
var hits = [];

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

}

}

#2

HI this line

var text ="Joe";

you should put at least once your name (the one you put in the variable myName) inside the variable text.


#3

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