Your second "for" Loop


I get the error message "Oops, try again. Make sure you're pushing letters to the hits array!"
And my outcome is 15

var text = "I ate a potatoe with tomatoes\
because the potatoe said my name Henry because Henry\
and awesome name for Henry."
var myName = "Henry";
var hits = [];

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


this should be hits.push( text[j])


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