This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 规范里用来声明 var/let 变量的内部方法是 CreateMutableBinding(),初始化变量用 InitializeBinding(),为变量赋值用 SetMutableBinding(), | |
| 引用一个变量用 GetBindingValue()。在执行完 CreateMutableBinding() 后没有执行 InitializeBinding() 就执行 SetMutableBinding() 或者 | |
| GetBindingValue() 是会报错的,这种表现有个专门的术语(非规范术语)叫 TDZ(Temporal Dead Zone)。 | |
| 标准说用let和const初始化失败的变量将会永久的不能初始化了。 | |
| let/const v = xx // xx is not defined | |
| let/const v = 1 // v has already been declared | |
| v = 1; let c = v // v is not defined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| f = (i)=>{ | |
| return ()=>{return i;} | |
| } | |
| var a = [] | |
| var b = [] | |
| var c = [] | |
| (()=>{ | |
| for(var i=0; i<5; i++){ |
NewerOlder