1.变量提升的机制 var tmp = new Date(); function f() { let tmp = 'a'; console.log(tmp); let tmp = 'helloworld'; // 重复声明,报错 console.log(tmp); } f(); var tmp = new Date(); function f() { var tmp = 'a'; console.log(tmp); var tmp = 'helloworld'; // 变量提升,不会报错 console.log(tmp); }...