Not pushing code.. cant find the problem


#1


/*jshint multistr:true */
var text = "luisluisluisluisluis";

var myName= "Luis";

var hits = [];

for (var i = 0; i < text.length; i++) {
    if(text[i] === myName[0]) {
        for (var j = i; j < i + myName.length; j++) {
            hits.push(text[j]);
        }
    }
}


#2

text doesn't contain your name, so it can't be found

sting comparison is case sensitive, L == l is false


#3

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