What is wrong ? help me


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++) {




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"
You cannot use a variable which consist of 2 word's
like your =yong jin=

 var myName = "Yong";


var myName = "jin";

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=