6/7 It lets me get into the next step but I didn't understand it really well


/*jshint multistr:true */
var text = "Alfredo will play football in two days. Alfredo \
also likes paintball. Alfredo was sick today"

var myName = "Alfredo"

var hits = []

for (var i = 0; i < text.length; i++) {
if (text[i] === "A") {
for (var j = i; i < j + myName.length; i++) {

if ( hits.length === 0) {
console.log("Your name wasn't found!");
else {

Here is the code, Thanks for the Help.


Hi @alfre360

What didn't you understand ?


You are looping through the text sentence finding any word that contains an A, if you find an A anywhere in the whole sentence you then take all the letters in that word that contains the A and push each one of the letters in that word into your hits array. This is a flawed solution since it only works if your name is the only word with A in it. I hope that helps, if you are still confused I can explain further :).


Sorry for not specifying, I am fine now thanks for the help! @onepunch_man @edwin0258