SOURCE

// function foo(x, y = 1) {
//   console.log(x,y);
// }
// foo();

let x=2;
function foo(y=x) {
  console.log(y);
}
foo();
console 命令行工具 X clear

                    
>
console