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

140.[js]JavaScript 中的作用域(scope)是指什么? #140

Open
webVueBlog opened this issue Mar 31, 2020 · 1 comment
Open

140.[js]JavaScript 中的作用域(scope)是指什么? #140

webVueBlog opened this issue Mar 31, 2020 · 1 comment
Labels
JavaScript JavaScript

Comments

@webVueBlog
Copy link
Member

[软技能]

@webVueBlog webVueBlog added the JavaScript JavaScript label Mar 31, 2020
@webVueBlog
Copy link
Member Author

在 JavaScript 中,每个函数都有自己的作用域。作用域基本上是变量以及如何通过名称访问这些变量的规则的集合。只有函数中的代码才能访问函数作用域内的变量。
同一个作用域中的变量名必须是唯一的。一个作用域可以嵌套在另一个作用域内。如果一个作用域嵌套在另一个作用域内,最内部作用域内的代码可以访问另一个作用域的变量。

@webVueBlog webVueBlog changed the title 140.[软技能]JavaScript 中的作用域(scope)是指什么? 140.[js]JavaScript 中的作用域(scope)是指什么? Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript JavaScript
Projects
None yet
Development

No branches or pull requests

1 participant