Parameters of outer function in JavaScript

The parameters of the outer function will also be available in the inner one:

javascriptfunction test(num) {
  function func() {
    console.log(num); // shows 1
  }
  
  func(); // calls the inner function
};

test(1); // passes a number as a parameter
Задание 1

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

javascriptfunction test(num1, num2) {
  function func() {
    console.log(num1 + num2);
  }
  
  func();
}

test(1, 2);
Задание 2

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

javascriptfunction test(num1, num2) {
  function func() {
    console.log(num1 + num2);
  }
  
  num1 = 2;
  func();
}

test(1, 2);