5/7 Second "For" Loop


Not sure what I did wrong, help is greatly appreciated!
/*jshint multistr:true */
var text = "Reality is an illusion";
var myName = "Allison";
var hits = [];
for ( var i = 0; i < text.length; i++);
if (text[i] === myName[0]) {
for (var j = i; j < (i + myName.length); j++) {


Hey @deviantambivert,

Loops like the for loop have one thing they should have and what they shouldn't have.

What they should have:

  • Every loop must have two corresponding brackets


However, what they shouldn't have:

  • A semi colon before the first corresponding bracket, but after the loop.


Hope it helped!:smiley: