In Part 6. Log It , all that is logged is " []"


#1

var text = "Yo, what monkey nuts are \ these, big Dave ol titties \ wrapped around Dave in \ these muthalickas.";
var myName = "Dave";
var hits = [];
for(i = 0; i < text.length; i++){
if (text[i] === "D"){
for(j=i;j<(i+myName.length);j++){
hits.push(text[j])
}
}
}
if(hits.length=0){
console.log("Your name wasn't found");
} else{
console.log( hits );
}

it says the code is right, but all that comes out is "[]".
This makes sense to me because i set the var hits = []
So how would i make it so that it spits out however many of myName's it found in the text?


#2

should be,

if (hits.length === 0){

Also, please edit your text to something more appropriate. Thank you.