1、

  1. var test = function(num){
  2. console.log(num);
  3. var num =30;
  4. }
  5. test();

2、

  1. var test = function(num){
  2. console.log(num);
  3. var num =20;
  4. function num(){
  5. console.log("hello world")
  6. }
  7. }
  8. test(10);

3、

  1. var test = function(num){
  2. console.log(num);
  3. var num =20;
  4. function num(){
  5. console.log("hello world")
  6. }
  7. console.log(num)
  8. }
  9. test(10);