71

JavaScript变量的生命周期:为什么let不被提升

 6 years ago
source link: https://juejin.im/post/5aa631ab5188255587233214
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
原文链接:dmitripavlutin.com/variables-l… 提升实际上是把变量和函数定义移动到作用域顶部的过程,通常发生在变量声明var或函数声明function fun() {...} 。 当let(包括和let有同样声明行为的const和c

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK