当前位置:网站首页>作用域和作用域链
作用域和作用域链
2022-06-12 20:29:00 【站在桥上烤冷面】
1.作用域
a.什么是:保存一个变量的可用范围
b.js中包括两级作用域 :全局作用域和函数作用域
2.作用域的原理
定义函数时,每个函数身上都会保存全局变量和函数体内部自己创建的变量,
调用函数时,临时创建作用域对象,并将作用域对象保存起来,每用到一个变量,函数首先会在自身查找,如果找不到才会去全局查找,遵循就近原则。函数调用完成后,会清楚在函数体内部创建的变量,所以局部变量在函数调用完成后就不能在用了。
3.作用域链
什么是?保存着一个函数所有可用的作用域对象的链式结构

边栏推荐
- Compilation of programs
- Login to MySQL
- What does MySQL full value match mean
- Index optimization principle
- MySQL + PostgreSQL batch insert update insertorupdate
- Dynamic memory management
- 可测性设计学习笔记
- golang类型断言理解[go语言圣经]
- WordPress station group tutorial automatic collection of pseudo original release tutorial
- DFT learning notes
猜你喜欢

Wall Street cheat sheet

Alipay payment episode 11: monitoring after successful payment callback

How mysterious is "PIP not an internal or external command, nor a runnable program or batch file"

A simple understanding of consistent hash

解决cvxpy报错The solver GLPK_MI is not installed

Design rule check constraint (set_max_transition, set_max_capability)

Since using low code development, the development efficiency has been increased by 10 times

When will the index fail

Why my order by create_ Time ASC becomes order by ASC

How mysterious is "PIP not an internal or external command, nor a runnable program or batch file"
随机推荐
The difference between MySQL full table scanning and indexing
What is a hash index?
没有学历,自学软件测试,找到一份月入过万的测试工作真的有可能吗?
Optimization of SQL statements
How to download putty using alicloud image?
QT pro文件配置ffmpeg宏
Experience Technology Department of ant group launched the 2023rd school recruitment
Why can't fields with high duplicate values be indexed (such as gender fields)
Properties to YML
In 2022, 20 cities with the largest number of college students in China
Lx09 query tr list of SAP WM preliminary level
牛客网:三数之和
CentOS7安装MySQL5.7操作说明
MinIO客户端(mc命令)实现数据迁移
How to make a computer installation and startup USB flash disk
The execution results of i+=2 and i++ i++ under synchronized are different
MySQL Basics
Connectez - vous à MySQL
SAP WM preliminary transaction code lx29 - list of fixed storage bins
What is disk IO?