当前位置:网站首页>this points to the problem
this points to the problem
2022-07-31 05:58:00 【hug the whirlpool】
The pointing of this cannot be determined when the function is defined. Only when the function is executed can it be determined who this points to. In general, the final pointing of this is the object that called it.
At this stage, let's take a look at a few this pointers
1. In the global scope or in ordinary functions, this points to the global object window (note that this in the timer points to window)
In the function of the first parameter of the timer method, this also points to the window object
2. In the method, whoever calls the method, this points to whom

3. This in the constructor points to the newly created instance

边栏推荐
- On the side of Ali, tell me what are the application scenarios of message middleware you know?
- UiBot存在已打开的MicrosoftEdge浏览器,无法执行安装
- mysql password modification method in Linux (pro-test available)
- First acquaintance with Flask
- js中的全局作用域与函数作用域
- 5 methods of MySQL paging query
- cocos2d-x-3.2图片灰化效果
- 通信原理——纠错编码 | 汉明码(海明码)手算详解
- 使用ps | egrep时过滤排除掉egrep自身
- 为什么bash中的read要配合while才能读取/dev/stdin的内容
猜你喜欢

(Crypto essential dry goods) Detailed analysis of the current NFT trading markets

UiBot存在已打开的MicrosoftEdge浏览器,无法执行安装

一文速学-玩转MySQL获取时间、格式转换各类操作方法详解

安装Multisim出现 No software will be installed or removed解决方法

Common JVM interview questions and answers
![[Cloud Native] What should I do if SQL (and stored procedures) run too slowly?](/img/40/be3a30743ee2bc6c82f82ab852f29c.png)
[Cloud Native] What should I do if SQL (and stored procedures) run too slowly?

为什么bash中的read要配合while才能读取/dev/stdin的内容

碎片化NFT(Fractional NFT)

Linux中mysql密码修改方法(亲测可用)

DeFi Token in the project management
随机推荐
cocos2d-x-3.2 Physics
[Elastic-Job source code analysis] - job listener
mysql启动报错The server quit without updating PID file几种解决办法
利用phpstudy搭建DVWA
Install mysqldb in mac10.14
Build DVWA with phpstudy
mac10.14中安装mysqldb
为什么redis是单线程还那么快?
MySQL面试题大全(陆续更新)
The latest MySql installation teaching, very detailed
Fragmented NFT (Fractional NFT)
Build vulhub vulnerability shooting range on kali
Why is the redis single-threaded also so fast?
代码执行漏洞
【云原生】开源数据分析 SPL 轻松应对 T+0
MySQL分页查询的5种方法
Attribute Changer的几种形态
Common JVM interview questions and answers
对于输出点是时间戳的渗透测试方法(以Oracle数据库为例)
The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered