It should work fine but doesnt


/*jshint multistr:true */
var text = "asdasdwd asdw dan wda sdwd awdwawdw awd dan dwadawuhjr guy \
adsjbnuwbd kmawn dan dwadwdadwadw dan!";
var myName = "dan";
var hits = [];
for (var i = 0; i < text.length; i++) {
if(text[i] === "D") {
for (var j = i; j < (myName.length + i); j++) {

Oops, try again.It looks like your second 'for' loop isn't pushing values to the hits array.

I have no clue why this isnt working. As checked with other posts it should work fine!


Fixed, the  if(text[i] === "D") is case sensitive!

Continuing the discussion from It should work fine but doesnt: