Not finding my name for Log It!


I've tried with hits.length === 4 as well.

/*jshint multistr:true */

var text = "lorem ipsum asdlkfjlskdj klajsdflksjdl kj \
alskdjfla prop naem name sdkfj ksdjlk name asldkfj lskdj namean";
var myName = "name";
var hits = [];

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

if (hits.length === 3) {
else {
    console.log("Your name wasn't found!");


You will have to use



Still only says "Your name wasn't found!"


You will have to change the last IF condition

(hits.length === 3)


(hits.length > 0)


I appreciate your help but it's still not working.


Please display the full code you are using now....


I ended up just looking at the code from step one and fixing accordingly. Still ended up a bit funny in the preview window (all the letters stacked up vertically instead of across the page), but I think I'll just move to the next exercise.


That is correct, as every character-of-your-name found is 1 Array-Element.....


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