Victory... or not


Hi guys, though I passed, I can't seem to get my name printed out! All I get is a "Your name wasn't found!" :frowning: A little help please? Thanks!

Replace this line with your code. 
var text = "hi this is ash";
var myName = "ash"
var hits = [];
for ( var i=0; i<text.length; i++){
    if ( text[i] === "a"){
        for (var k=i; k<(i+myName.length); k++){
} if (hits === "ash"){
} else {
    console.log("Your name wasn't found!");


hits is an array, so it is very unlikely it will equal a string

you could check if the length of hits was greater then zero by using .length?


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