Conclusion 2: "Oops, it looks like you didn't log anything" ... BUT I DID!


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/getting-started-v2/4/5?curriculum_id=506324b3a7dffd00020bf661

<In what way does your code behave incorrectly? Include ALL error messages.>
I created my if/else statement and logged the exact sentence I was supposed to, but Codeacademy says that I didn’t log anything. Error: “Oops, try again. It looks like you didn’t log anything!”

Can anyone help here??

```

// Not sure where to begin? Check the Hint!
var myName = “Lily”
if (myName.length==5){
console.log=“Wow!”;
}
else {
console.log=“I finished my first course!”;
}

<do not remove the three backticks above>

#2

@lilyelle

[quote=“lilyelle, post:1, topic:33937”]
console.log=“Wow!”;[/quote]

Remove your = sign. Remember a console.log syntax:

console.log("something in here");

#3

oh, of course. thanks! however, even with correct syntax now it says “your code doesn’t look quite right.”

WHAT AM I DOING WRONG???

var myName = “Lily”
if (myName.length==5){
console.log(“Wow!”);
}
else {
console.log(“I finished my first course!”);
}


#4

@lilyelle

Try putting a semicolon here.


#5

still nothin.

:tired_face:


#6

You replaced the console.log with that string so it doesn’t contain the normal console.log code anymore. It is easy to restore it by reloading/refreshing the web page.


#7

oh my god. refreshing worked, and somehow that just makes me more frustrated with this :wink: haha, thank you!!

I’m not sure what you mean by the “normal” console.log code though.


#8

When you use a command like console.log, there is code that your web browser’s JavaScript interpreter runs to make that command work.

When you do something like

console.log = "something";

then you have replaced that underlying code so console.log doesn’t work any more.