Basic JavaScript - Beginner stuck!

Hey guys! I’m new to JavaScript so I can’t understand what I did wrong here… Is saying that " FCC should be a constant variable declared with const .", if you can help my beginner dumb question I would be grateful!! Thank you.

Your code so far



const FCC = "freeCodeCamp"; // Change this line
let fact = "is cool!"; // Change this line
fact = "is awesome!";
print = console.log(FCC, fact); // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 OPR/84.0.4316.21

Challenge: Declare a Read-Only Variable with the const Keyword

Link to the challenge:

Let’s review line by line:

const FCC = "freeCodeCamp"; // Change this line

Awesome! You changed it to const and uppercased it. Good job

let fact = "is cool!"; // Change this line
fact = "is awesome!";

Good. Changed it to let, because “let” lets us change the value.

print = console.log(FCC, fact); // Change this line

Here we have a problem.
You are storing console.log(FCC, fact); result in a variable named print.

Do you see the declaration of this variable “print”? Any var print or const print or let print?
And why you are storing the results of console.log(FCC, fact); in the print variable? That is something that was not requested.
Furthermore, console.log(FCC, fact); returns undefined, so it will store undefined in the print variable.

The function console.log only outputs, and it doesn’t return anything.

Try using console.log alone, without storing the results anywhere. Just let it output its things.

console.log(FCC, fact);

like this.

1 Like

Thank you so much!!! You helped me A LOT!! I will pay more attention with the details, it was a silly mistake… again, thank you!!

1 Like