6/7 only my name


#1

So far i am getting this but i would like to only print my name when my full name is in de tekst not when someting starts with an f.

var text = "vkav vkzvkcm freek fandsfknz\
freek advakdsgkln. freek.";
var myName = "freek";
var hits = [];
for (var i = 0; i < text.length; i++){
if (text[i] === myName[0]) {
for(j = i; j <= i + myName.length; j++){
if(text[j] === myName[j-i]){
hits.push(text[j]);
}
}

if (hits.length > 2){
console.log(hits);
}else {console.log("Name Not here");}
}
}


#2

You don't need this:

That probably makes a problem....