Oops, try again. It looks like your if/else didn't log 'You got a true!' to the console


#1

Hi!
Can someone please tell me what I'm doing wrong?

after debugging:

if (10 === 10) {
console.log="You got a true!";
} else {
console.log="You got a false!";
}

I got this error:
Oops, try again. It looks like your if/else didn't log 'You got a true!' to the console.


#2

console.log() uses parentheses, not an equals.


#3

When I use parentheses I got the error in console (like "Its not a function").
Now it
s already works. I don`t really understand what the problem was.
I think, it was a bug.

Thank your for help!


#4

The problem was that when you did this:

console.log="You got a true!";

you replaced the built-in code for console.log with "You got a true!".

Reloading/refreshing the browser restores the built-in code.


#5

Thank you a lot!
Now I understand what the problem was