可変リフトや機能を高めます

可変リフトに優先し、変数を覆われていないが、カバー変数に割り当てられる機能を強化

var b
	function b(){console.log("我是一个函数")}
	console.log(typeof b)   //function
	console.log(b())  //“我是一个函数”  ‘undefined’
	console.log("----------------")
	b = 4
	console.log(b)   //4
	console.log(b())  //b is not a function
 //面试题2
	if(!(z in window)){
	    var z = 1
	}
	console.log("z是多少---",z)  //undefined

	var c = 1
	function c(c){
	    console.log("c是多少---",c)
		var c = 3
	}
	c(2)   //c is not a function

 

公開された54元の記事 ウォンの賞賛8 ビュー70000 +

おすすめ

転載: blog.csdn.net/yang295242361/article/details/101675508