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

let const 存在暂时性死区的问题 #16

Open
upgrace opened this issue Apr 28, 2020 · 0 comments
Open

let const 存在暂时性死区的问题 #16

upgrace opened this issue Apr 28, 2020 · 0 comments

Comments

@upgrace
Copy link
Owner

upgrace commented Apr 28, 2020

  原理: 只要进入当前作用域,所要使用的变量就己经存在,但是 不可获取,只有等到声明变量的那 一行代码出现 ,变量才会从暂时性死区中移除, 可以获取和使用该变量。
  作用:为了减少运行时的错误,防止在变量声明前使用变量
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant