function fn(a,c){
console.log(a) //f a(){}
var a = 123
console.log(a) / / 123
console.log(c) //f c(){}
function a(){}
if(false) {var d=678
}
console.log(d)//undefined
console.log(b)//undefined
var b =function() {}
console.log(b)//f(){}
function c(){}
console.log(c)//f c(){}
}
fn(1.2)
/ / the precompiled
// Scope creation phase precompile phase
// What was done during precompilation
The AO object is accessed by the JS engine itself
// the function declaration overwrites the variable declaration. // The function declaration overwrites the variable declarationAO: {a:undefined 1 function a(){}
c:undefined 2 function c(){}
d:undefined
b:undefined
}
Copy the code