摘要:
In ES6, IIFE is not necessary:// IIFE写法(function () { var tmp = ...; ...}());// 块级作用域写法{ let tmp = ...; ...}另外,ES6也规定,函数本身的作用域,在其所在的块级作用域之... 阅读全文
摘要:
Fialdcase 1: let can work in it's block{ let a = 10; var b = 1;}a // ReferenceError: a is not defined.b //1Case 2: Let has no "Hosting" Problemf... 阅读全文
摘要:
var message = "Hi";{ var message = "Bye"; }console.log(message); //ByeThe message inside the block still has impact on the outside.Just rememb... 阅读全文