Local variables in JavaScript functions

Variables defined within a function are called local. Unlike global variables, local variables are only visible inside the function, and not visible from the outside:

javascriptfunction func() {
  let num = 5; // the local variable
  console.log(num);
}

console.log(num); // will not output anything, but will throw an error to the console
Задание 1

Determine what will be output to the console without running the code:

javascriptfunction func() {
  let num = 5;
  return num;
}

console.log(num);
Задание 2

Determine what will be output to the console without running the code:

javascriptfunction func() {
  let num = 5;
  return num;
}

console.log(func());