Learn Function Basics - Learn Function Basics Lesson C

Tell us what’s happening:

The answer is correct but the example code doesn’t produce any output at the first place. A user can only see output after calling the function.

let x = 10;

function myFunction() {
  let x = 20;
  console.log(x);
}

This piece of code doesn’t produce any output. But

let x = 10;

function myFunction() {
  let x = 20;
  console.log(x);
}

myFunction();

This one does.

Your code so far

Your browser information:

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

Challenge Information:

Learn Function Basics - Learn Function Basics Lesson C

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

Thanks, I opened a issue on Github regarding this.

Please also post a link to the issue in your reply so people can find it later if needed.

Okay, here’s the link of Github issue report For Odin project

I forgot to link it under “Odin project” and also I can’t add or change label, if someone can please add the label of “odin project” too. Thanks.