【JS】Intermediate5:Scope

1.Scope=variable visibility

a variable’s scope is the part of your code that can access and modify that variable.

JavaScript has function scope

Global variables — that is, variables that can be read and modified anywhere in your application

it’s best to limit the scope of a variable as much as possible, making it visible to as few parts of your code as possible

3.Function scope

variables are not visible outside of the function in which they were declared.

4.Child scopes

上一篇:linux环境下,清空history中记录的历史命令


下一篇:App项目升级Xcode7&iOS9(续) - This bundle is invalid. The bundle identifier contains disallowed characters