5. Second loop: can't push the name



It says "Oops, try again. It looks like your second 'for' loop isn't pushing values to the hits array. Make sure it's working properly and that myName's text appears somewhere in the text variable."
I banged my head on the wall, I checked with some other well done codes and I just couldn't find the mistake.

/*jshint multistr:true */
var text = "BAUMAN Zygmunt, press Name Press"

var myName = "Name"
var hits=[];

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


you have semi-colon after i++) which interupts the loop, remove the semi-colon


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