#5 help


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++) {
    if(text[i] === 'D') {
        for (var j = i; j < i + myName.length); j++) {



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


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