var a = 0;
function fn(a, b, c) {
console.log(a);
a = 1;
console.log(a);
}
fn()
console.log(a);
/***************************/
函数的形参在函数体内部也是被声明了的,只是没有被赋值和显示;其实是这样的
var a = 0;
function fn(a, b, c) {
var a,b,c;
console.log(a);
a = 1;
console.log(a);
}
fn()
console.log(a);
05-24
964
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-21
347
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)