预编译对象-四部区

//1.创建AO对象
//AO{
//2.找形参和变量声明,将变量和形参名作为AO属性名,值为undefined
//3.实参形参值统一
//4.函数体找函数声明,值赋予函数体
//}

// function fn(a) {
// cosole.log(a);//function fn() undefined

// var a = 123;
// console.log(a);//123

// function a () {}
// cosole.log(a)//function a ()undefined

// var b = function () {}
// console.log(b); //123
// function d () {}
// }
// fn(1);


// function test(a,b){
// console.log(a);//function () {}
// console.log(b);//undefined
// var b = 234;
// console.log(b);//234
// a = 123;
// console.log(a);//123
// function a() {}
// var a;
// b = 234;
// var b = function () {}
// console.log(a);//123
// console.log(b);//function
// }
// test(1);

//问题:2
// function bar() {
// return foo;//function
// foo = 10;
// function foo() {}
// var foo = 11;
// }
// console.log(bar());

//问题:3
// console.log(bar());//11
// function bar() {
// foo = 10;
// function foo() {

// }
// var foo = 11;
// return foo;
// }


//问题:4
// a = 100;
// function demo(e) {
// function e() {}
// arguments[0] = 2;
// console.log(e);//2
// if(a) {
// var b = 123;
// function c() {}
// }
// var c;
// a = 10;
// var a;
// console.log(b);//undefined
// f = 123;
// console.log(c);//undefined
// console.log(a);//10
// }
// var a;
// demo(1);
// console.log(a);//100
// console.log(f);//123

var a = 10 + "20" * 1;
document.write(a);

posted on 2022-06-25 17:31  爱前端的小魏  阅读(22)  评论(0编辑  收藏  举报

导航