I don't know what's wrong with this code can someone please help I have declared a const but it keeps telling me to declare a cont!

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

function printManyTimes(str) {

// Only change code below this line
//let fact= " is cool!";
//const FCC= str.toUpperCase();
const FCC = "freeCodeCamp";
let fact = "is cool!";
fact = "is awesome!";
//const sentence = str + " is cool!";

  console.log(FCC,fact);


// Only change code above this line
}
printManyTimes("freeCodeCamp");
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36

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

Link to the challenge:

I did the following and passed the test:

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

I tried it your way, with the function and it fails the test for some reason. I think, for testing purposes, you should just write the code without a function.

Thank you mushraf I thought tere is something wrong with my code but it turns out the opposite.

1 Like

The test is asking you to do one specific thing. If you do a completely different thing the test won’t pass. The task is not to write a function, that’s not close to what the instructions are telling you to do.