Your second "for" loop


I need help with this topic. can you please tell me what is wrong with my code?

This is where I am stuck at

Codecademy's response is "Oops, try again. 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."

/*jshint multistr:true */
var text = "Hi There";
var myName = "Paul Taylor";
var hits = [];
for (var i = 0; i < text.length; i++) {
    if (text[i] === "P") {   
        for (var loop = i; loop < myName.length + i; loop++) {


You name is not in the text variable. Make sure you type something like "blah blah blah blah blah Paul Taylor blah blah blah blah"


Thanks terarunner77454.


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