Log it! (Code passes but doesnt log name)


As the title implies, my code DOES pass, but it doesn't log and i cant seem to find the error. Could someone help me out?

/*jshint multistr:true */
var text = "Hey man, how are you doing? My name is Beau - i don't know what made my parents pick Beau as a name but i think Beau is pretty Beau :)";
var myName = "Beau";
var hits = [];

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

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


In your IF condition you will have to use a comparison operator ===

hits.length === 0

instead of using the assignment operator =



Thank you very much! Atleast i was close! ;D