5. Your second "for" loop Hits array error. Debug pls


Hi, i m getting this error "It looks like your second 'for' loop isn't pushing values to the hits array. " And cant found the error, can someone help me pls :slight_smile:

/*jshint multistr:true */

var text = "Hey, how are you \
doing? My name is Jose.";

var myName = "Jose";

var hits = [];

for(var i=0; i > text.length; i++){
    if(text[i] === "J"){
       for(var q = i; q < myName.length + i; q++) {

Thanks for ur time.


Did you mean i<text.length?


omg that was my mistake, i didnt see that error.

Thanks biff! now i can continue with this.


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