#5 help


#1


5. Second "for" loop


there was a problem with your syntex


/*jshint multistr:true */
var text = "Say hi to Daniel at the store\
he was supposed to swing by today";
var myName = "Daniel"
var hits = []
for (var i=0; i > text.length; i++) {
    console.log(i)
    if(text[i] === 'D') {
        for (var j = i; j < i + myName.length); j++) {
            hits.push(text[D]);
        }
    }
}


#2

here:

for (var j = i; j < i + myName.length); j++)

parentheses don't seem to match

also, your first for loop will evaluate to false the first time condition is evaluated, so the loop never runs


#3

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