I need help understanding the console log

I’ve begun the debugging section of the javascript course. I’m using Chrome and I know that I can open the console log with control, shift, J. My problem is that I have no idea what I’m looking at. It’s not readily apparent where the info from my is displaying. Does anyone have a good explanation of how to read the console log?

f12 works too!

Click on the “Console” tab on top.
Click on the second icon on the second row “Clear console” - it looks like a “no smoking” sign.

That will get you started.

I tried to include a screen shot.
I know how to view the console log, I know how to clear it. I do not understand how to read it.

You can see in my screen shot that there is no result for the sumAB or the variable a in the log.
However, this code runs and passes the test.

From what I see in your screenshot, you can absolutely see the results for both of those console logs:

let a = 5
let b = 1

console.log(a) //if a equals 5 and a++ adds 1 to 5 before the console log, a equals 6
let sumAB = a + b
console.log(sumAB) //if a equals 6 and b equals 1, then the result of adding them together is 7

I see what you mean. As @huntinghawk1415 mentioned above, your browser console (f12) does show the results.

You’re talking about the FCC test suite. It is a bit finicky at times. In this case, since you ran the test, it cleared the console. All you need to do to view the results there is make any change to your code. Something simple like deleting a ; and retyping it will do.

If you start using a lot of console.log in your code you will start needing to add to them something to recognise them, in your cose you could add two statements just before the two existing ones

console.log("a"); // so this logs a string with value of "a" so you know that the value printed below is the one of the variable a 

And the same for the other one:


Thanks, yes I was confused why I didn’t see it there.

That’s a good tip. Thank you.

Also, this probably might go with out saying, but i don’t think i saw it mentioned.

When you use console.log you are writing to the console.

Hope they is somewhat helpful