for loop within a loop JS : i am trying to search for my name in a text using for loop within a for loop. 
but it's returning half of the letters and sometimes undefined. 
 
    var text = 'huurrr hurrrh u rajat huhuhw dwhidwid sdijhsid \
    hurhrhr hrher rajat ekkdwihd ruidhwui rajat';

    var myName= 'rajat';
    var hits = [];

    for (var i = 0; i < text.length; i++) {
    if (text[i] === 'r') {
        for (var j= i; j <= myName.length; j++) {
            hits.push(myName[j]);
            }       
    }
    }
    console.log(hits);
can somebody help with this please ?