当前位置:网站首页>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
边栏推荐
猜你喜欢
[uiautomation] Get WeChat friend list (stored in txt)
The server time zone value ‘й‘ is unrecognized or represents more than one time zone
自定dialog 布局没有居中解决方案
js中的全局作用域与函数作用域
js中的对象与函数的理解
为什么redis是单线程还那么快?
【windows】--- SQL Server 2008 超详细安装教程
[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version
Linux修改MySQL数据库密码
UiBot存在已打开的MicrosoftEdge浏览器,无法执行安装
随机推荐
[Ubuntu20.04 installs MySQL and MySQL-workbench visualization tool]
this指向问题
【Elastic-Job源码分析】——作业监听器
[uiautomation] Get WeChat friend list (stored in txt)
Detailed explanation of pointers in C language
MySQL压缩包方式安装,傻瓜式教学
UiBot存在已打开的MicrosoftEdge浏览器,无法执行安装
【云原生】SQL(及存储过程)跑得太慢怎么办?
[Elastic-Job source code analysis] - job listener
Powershell中UTF-8环境中文乱码解决办法
MySQL高级学习笔记
MySQL compressed package installation, fool teaching
cocos2d-x-3.2图片灰化效果
数据库 | SQL查询进阶语法
js中的函数
MySQL高级SQL语句(二)
通信原理——纠错编码 | 汉明码(海明码)手算详解
【swagger关闭】生产环境关闭swagger方法
Regular Expression Basics
How to distinguish big and small endian in C language