当前位置:网站首页>Scope and scope chain
Scope and scope chain
2022-06-12 20:35:00 【Stand on the bridge and bake cold noodles】
1. Scope
a. What is? : Save the available range of a variable
b.js Contains two levels of scope : Global scope and function scope
2. The principle of scope
When defining a function , Each function will store global variables and variables created by itself in the function body ,
When you call a function , Create scope objects temporarily , And save the scope object , Every variable used , The function first looks for itself , If you can't find it, you will go to the global search , Follow the principle of proximity . When the function call is complete , You will know the variables created inside the function body , Therefore, local variables cannot be used after the function call is completed .
3. Scope chain
What is? ? It stores the chain structure of all available scope objects of a function

边栏推荐
- 登錄mysql
- 循环插入excel某一列,以及多列之和
- Lightroom 大使系列:用 Meg Loeks 捕捉怀旧之情
- 大小端转换
- Kyma application connectivity feature introduction
- [tutorial] Firefox send: deployment method of Firefox open source temporary file sharing service platform
- Why my order by create_ Time ASC becomes order by ASC
- Detect current system language
- 机器学习资料汇总
- Typescript definition type: type 'timeout' cannot be assigned to type 'number';
猜你喜欢

EditText控制从左上角开始

牛客网:三数之和
![[leetcode 7 solution] integer inversion](/img/72/b358a67eaedda48e1c0aebdaec04a5.jpg)
[leetcode 7 solution] integer inversion

In 2022, FISCO bcos MVP recognized that the channel was open and invited you to become an open source leader

Scala基础语法入门(三)Scala中的各种运算符

Successful transition from self-study test halfway, 10K for the first test

Before job hopping, Jin San made up the interview questions. Jin San successfully landed at Tencent and got a 30K test offer

Nexus3 build local warehouse

Niuke net: somme des trois nombres

半路自学测试成功转行,第一份测试工作就拿10k
随机推荐
测试人如何规划自己的未来?才能实现入行2年达到25k?
Go memory escape analysis
牛客網:三數之和
MySQL installation and Application
JS深浅拷贝
The execution results of i+=2 and i++ i++ under synchronized are different
HR SaaS unicorn is about to emerge. Will the employee experience be the next explosive point?
EDI 855 purchase order confirmation
The joint empowerment plan of Baidu PaddlePaddle large enterprise open innovation center was launched! Help Pudong to upgrade its industry intelligently
登录mysql
Nexus3 build local warehouse
Proxy and reflection
同花顺能开户吗,同花顺在APP上可以直接开通券商安全吗 ,买股票怎么网上开户
What is the difference between union and union all
Centos7 installing MySQL 5.7
Unauthorized rce in VMware vCenter
It has been engaged in the functional test of 10K to the test development of 40W annual salary for 5 years, and spent 7 days sorting out the super comprehensive learning route
What does MySQL full value match mean
What are the barriers that Huawei terminals need to cross if they want to rely on the intelligent turnover of the whole house?
Zhangqiming, vice director of the United Front Work Department of the CPC Anhui Provincial Committee, led a team to investigate the HoloNet Royal Hefei R & D base