5/7 "It looks like your second 'for' loop isn't pushing values to the hits array. Make sure it's working properly and that myName's text appears somewhere in the text variable." Error


#1

Been on this for quite awhile can someone help me?

var text = "billionaires live in their own world!";
var myName = "Chris";
var hits = [];
for (var i = 0; i < text.length; i++)
{
if(text[i]==="C")
{
for (var j = i; j < (i+myName.length); j++)
hits.push(text[j]);
}
}


#2

Hi in the variable text

var text = "billionaires live in their own world!";

yous should put at least once your name in it


#3

Something so simple lol..Thanks a lot for your help buddy.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.