Log it, I'm struggling here, not sure what I am doing wrong


#1


https://www.codecademy.com/courses/javascript-beginner-en-XEDZA/0/6?curriculum_id=506324b3a7dffd00020bf661#


Replace this line with your code. 
var text = "Hey, how are you doing Adonte? My name is Adonte!";
var myName = "Adonte";
var hits = [];
for (var i = 0; i < text.length; i++) {
    if (text[i] ==="A") {
        for (var a = i; a < i + myName.length; a++) {
            hits.push(text[a]);
        }
    } 
}
if (hits.length === 0) {
    console.log("Your name wasn't found!")
} else {
    console.log(hits):    
}


#2

this line:

console.log(hits):

you use a colon instead of a semi-colon at the end


#3

hahaha woooooowwww o.m.g -_- thank you


#4

I like the analogy someone made: Programming is like writing a book, except if you forget one semi-colon somewhere, your program won't work where as the book is still readable. Quit true here :wink:


#5

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