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

var、let、const 的区别 #197

Open
lgwebdream opened this issue Jul 6, 2020 · 2 comments
Open

var、let、const 的区别 #197

lgwebdream opened this issue Jul 6, 2020 · 2 comments
Labels
JavaScript teach_tag 伴鱼 company 心娱 company 百分点 company

Comments

@lgwebdream
Copy link
Owner

No description provided.

@lgwebdream lgwebdream added JavaScript teach_tag 伴鱼 company 心娱 company 百分点 company labels Jul 6, 2020
@lgwebdream
Copy link
Owner Author

扫描下方二维码,获取答案以及详细解析,同时可解锁800+道前端面试题。

@talang1991
Copy link

var 定义的变量,没有块的概念,可以跨块访问, 不能跨函数访问。 let 定义的变量,只能在块作用域里访问,不能跨块访问,也不能跨函数访问。 const 用来定义常量,使用时必须初始化(即必须赋值),只能在块作用域里访问,而且不能修改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript teach_tag 伴鱼 company 心娱 company 百分点 company
Projects
None yet
Development

No branches or pull requests

2 participants