How to solve it,this show as same letter as full array


var text="rajkumar hello world";
var myName = "rajkumar";
var hits = [];
for(var i=0; i < text.length;i++){
if(text[i] === "r"){
for (var j=i; j<(i+myName.length);j++){
if(hits.length == 0){
console.log("Your name wasn't found!");


j contains the indexes of your name found in text, so then we can use text[j] to get/retrieve the letter, which we push into our hits array


yes, the problem has solved.
Thank you!