129   JS

1,语法分析:比如 var 是否写成 vor
2,预先编译:比如变量放到内存,默认取值 undefined
3,解释执行:赋值给变量,解释表达式函数

// 语法分析
var a;
var b = 1;

function c(){
	var cc=2;
}

var d = function(){
	var dd = 3;
}


// 编译伪代码
windown={
	a:undefined,
	b:undefined,
	c:function(){
		var dd=3;
	},
	d:undefined
}

// 解释执行

windown={
	a:undefined,
	b:1,
	c:function(){
		var cc=2;
	},
	d:function(){
		dd=3;
	}
}




Leave a Reply

Your email address will not be published. Required fields are marked *