Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript Hoisting(提升) | 会飞的菜虫 #25

Open
FlyingCaiChong opened this issue Dec 27, 2023 · 0 comments
Open

JavaScript Hoisting(提升) | 会飞的菜虫 #25

FlyingCaiChong opened this issue Dec 27, 2023 · 0 comments

Comments

@FlyingCaiChong
Copy link
Owner

http://flyingcc.cn/2023/12/27/javascript-hoisting/

什么是 Hoisting?在编译阶段,就在代码执行前几微秒, 会扫描查找函数和变量声明. 所有这些函数和变量声明都被添加到称为词法环境(Lexical Environment)的数据结构的内存中. 这样即使在源代码声明它们之前, 也可以使用它们. 什么是词法环境?词法环境是一个包含identifier-variable映射的结构(这里的identifier是指变量或函数的名称, variable是

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant