What is wrong ? help me


#1

var text = "hello nice to meet you my name is yong jin\ hi yong jin Im jane";
var myName = "my name is yong jin";
var hits = [ ];
for(var i = 0; i < text.length; i += 1) {
if( text[i] === "yong jin"){
for(var yong jin = i; i < "my name is yong jin".length; i++) {

}

}
}


#2

@ecln30,
-1
You must be aware that by using text[i]
you are actually targetting 1 character.
Thus you cannot compare =text[i]= against the string Value "yong jin"
-2
You cannot use a variable which consist of 2 word's
like your =yong jin=
either

 var myName = "Yong";

or

var myName = "jin";

-3
In your =first= FOR-loop you will want to compare
the character-found with =text[i]=
against the =first-character= of the string Value
associated to the variable =myName=