前端学习笔记202310学习笔记第一百壹拾天-作用域&作用域链&预编译&闭包基础6

阅读 37

2023-11-19

a=1
function test(e){
    function e(){}
    arguments[0]=2
    console.log(e)
    if(a){
        var b=3
    }
    var c;
    a=4;
    var a;
    console.log(b)
    f=5
    console.log(c)
    console.log(a)
}
var a;
test(1)
console.log(a)
console.log(f)
//GO{
//  a:undefined-->1
//   test:function test(){}
//   f:5
//}
//AO{
//   e:undefined---->1---->function e(){}--->2
//   b:undefined
//   c:undefined
//   a:undefined---->4
//}

运行结果

前端学习笔记202310学习笔记第一百壹拾天-作用域&作用域链&预编译&闭包基础6_clementine



精彩评论(0)

0 0 举报