Why dose this returen 3?


I dont understand why its returing the number of times my name comes up or why it let me pass because of it . here is the code can anyone help me.

/*jshint multistr:true */
var text = "trip trap look at that! here goes my name,Amber\ thats my name so hear it again Amber do you want to hear it again ? \ Amber";

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

for (var i = 0;i < text.length; i++)
if (text[i] ==="A")
{ for (var j = i; j < (myName.length + i); j++);
{ hits.push(text[j]); }

and then it gives and answer of 3


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

Delete the semi-colon " ; " at the end of your second for loop.


thanks I tried it but now it shows 15 instead. lol thats the correct number of letters I know but why no letters themselves ?


The next lesson will have you print the letters.


actually I worked it out but thanks so much for helping your awesome :smile: