Hotline:15911225507
Long Xiao
Login
Home-All Questions-Javascript-Main Content

JavaScript 中为什么要变量提升,导致了什么问题?

龙霄龙霄
Javascript
3 years ago
0
0
2.91K

在预解析和预编译的过程中,变量提升有助于提升性能,在函数执行时预先为变量分配栈空间。

增加了代码的容错性,让一些不规范的代码可以正常执行。

导致了什么问题:坑会导致输出为undefined

龙霄

龙霄

Lv1Vip2Rec2
以 Nuxt.js 之力,焕新 WordPress 体验
From: Course-JavaScript 教程
13.98W1W
Loading...
Share:
Long Xiao
No answers yet, be the first?
我要回答
Accepted answer rewards 100 points
Long Xiao
Please login first