You second "for" loop, please debugg


#1


var text = ['Hailey is learning\ to code she cool00'];
var myName = 'Hailey';
var hits = []
for(var i = 0; i < text.length; i++) {
    if(text[i] === "H") {
        for(var l = i; l <i + myName.length; l++) {
            hits.push(text[l]);
        }
    }
};
console.log(hits);


#2

nevermind corrected it


#3

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