For your second loop 5


I have absolutely no idea what I'm doing. Can someone please help me understand what I'm doing wrong, and possibly what I'm misunderstanding? Been stuck here and am clueless.

<P/*jshint multistr:true */

var text = "Blake blah blah Blake blah blah Blake";
var myName = "Blake";
var hits = [];

for (var i = 0; i > text.length; i++) {
.if (text[i] === "B") {
for (var j = i; j > text.length + j; j++) {
} } };


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

Fixed with this. But, still am not 100% sure what hits.push does, if someone could elaborate?


It basically "pushes" or in other words, places, the letters of your name in to the hits array.


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