当前位置:网站首页>After reading this article, I also understand this
After reading this article, I also understand this
2022-07-24 21:35:00 【Mark community】
// this Point to // 1. Point to Global variables window var a = 1;
function func() { var a = 2; console.log(this.a); } func(); //2 // 2. Point to the object that called it (funx() Medium this Only for immediate superiors ( Direct caller obj) be responsible for , No matter how many .) var b = 3;
function funx() { console.log(this.b); } var obj = { b: 4, funx } obj.funx(); //4
var aa = 15
function test() { console.log(this.aa) } var obj = { aa: 2, test } var obj0 = { aa: 3, obj } obj0.obj.test() // 3. You can pass it to a variable , And call it as well var d = 1
function test() { console.log(this.d) } var obj = { d: 2, test } var testCopy = obj.test testCopy(); // 4.call(), Who does the command point to var e = 7;
function test1() { console.log(this.e) } var obj = { e: 8, test1 } var testCopy = obj.test1 testCopy.call(obj); // 5. Point to the constructor instantiation object
More on :https://blog.csdn.net/weixin_44519496/article/details/120126852
边栏推荐
- “IRuntime”: 未声明的标识符
- Drawing library Matplotlib styles and styles
- Static & dynamic & file address book
- 驱动子系统开发
- 运动控制如何位置同步输出
- [shallow copy and deep copy], [heap and stack], [basic type and reference type]
- Redis (12) -- redis server
- What should I pay attention to when choosing the self built database access method on ECs?
- Sqlserver BCP parameter interpretation, character format selection and fault handling summary
- Intranet penetration learning (I) introduction to Intranet
猜你喜欢

Drive subsystem development
![[SOC] the first project of SOC Hello World](/img/ae/326312cb3b5a372c7b8b048936a9f2.png)
[SOC] the first project of SOC Hello World

Mysql database query is so slow. Besides index, what else can it do?

CAD sets hyperlinks to entities (WEB version)
![[Matplotlib drawing]](/img/ac/dea6fa0aff6f02477fba48c929fadc.png)
[Matplotlib drawing]

A simple method of converting SVG to PDF

驱动子系统开发

【类的组合(在一个类中定义一个类)】

One bite of Stream(7)

Build your own stock analysis system based on b\s architecture
随机推荐
What are intelligent investment advisory products?
How about Urumqi Shenwan Hongyuan securities account opening? Is it safe?
Problems with SQLite compare comparison tables
Uniqueness and ordering in set
Understand MySQL index and b+tree in an easy to understand way (supreme Collection Edition)
Can century model simulate soil respiration? Practice technology application and case analysis of century model
Is it safe for Hengtai securities to open an account?
[CCNA experiment sharing] routing between VLANs of layer 3 switches
IO flow overview
How to buy Xinke financial products in CICC securities? Revenue 6%
[record of question brushing] 16. The sum of the nearest three numbers
What is a self built database on ECs?
[Matplotlib drawing]
Information system project manager must recite the core examination site (47) project subcontract
Lecun proposed that mask strategy can also be applied to twin networks based on vit for self supervised learning!
One bite of Stream(7)
A simple method of converting SVG to PDF
支付宝上股票开户安全吗
Career development suggestions shared by ten CIOs
What should I pay attention to when choosing the self built database access method on ECs?