当前位置:网站首页>27. this指向问题
27. this指向问题
2022-06-11 19:54:00 【Suyuoa】
如果直接console.log(this),会返回window
![]()

把console.log(this)搞在函数中,直接调用函数this也指向window

![]()
把test()当做回调函数给定时器,也是指向window

![]()
放在对象中会指向对象

![]()
搞在一个事件中会指向触发事件的对象
![]()
![]()
构造函数中指向被构造出来的实例


边栏推荐
- VS2010 cannot open when linking sql2008 database
- YOLOv3 Pytorch代码及原理分析(二):网络结构和 Loss 计算
- 2022年最新宁夏建筑八大员(标准员)考试试题及答案
- ORA-01089 ORA-19809 ORA-19815 超过了恢复文件的限制
- Major work title and requirements of engineering earthquake resistance in autumn 21 [standard answer]
- Usage of duck beak wire stripper
- Building web applications
- 电源防反接和防倒灌 - 使用MOS 管和运放实现理想二极管
- Pyqt5 tips - button vertical display method, QT designer sets button vertical display.
- Web3 product manager guide - Jason
猜你喜欢

In 2021, the global revenue of flexible fireproof sealant is about 755.2 million dollars, and it is expected to reach 1211.7 million dollars in 2028
[help] how can wechat official account articles be opened in an external browser to display the selected messages below?

Leetcode2027. Minimum number of operations to convert a string (yes, once)

Hanging memory recursive dynamic programming (with example explanation POJ 1163)

Are there any techniques for 3D modeling?

JMeter installation

Flutter doctor 顯示xcode沒有安裝的解决辦法

Implementation of SQL online editor based on Vue + codemirror

Leetcode 1992. Find all farm groups (yes, once)

AHB2APB_ Bridge design
随机推荐
构建Web应用程序
Usage of duck beak wire stripper
干货!基于序列超图神经网络的信息扩散预测
In 2021, the global barite product revenue was about $571.3 million, and it is expected to reach $710.2 million in 2028
Edit the project steps to run QT and opencv in the clion
Golang学习笔记—基础篇
In 2021, the global revenue of Indian fragrant rice was about $12530 million, and it is expected to reach $21670 million in 2028
Web3 product manager guide - Jason
Zzulioj 2903: the power of warriors
【求助】请问如何让微信公众号文章在外部浏览器中打开后还能显示下方的精选留言?
VS2010 cannot open when linking sql2008 database
基于飞桨搭建的多模态学习工具包PaddleMM
2022年最新宁夏建筑八大员(标准员)考试试题及答案
Interface isolation principle
Hospital intelligent infusion management system source code hospital source code
Anaconda installation, jupyter notebook default startup path modification and nbextensions plug-in installation
C deep copy
Pyqt5 tips - button vertical display method, QT designer sets button vertical display.
Detailed explanation on persistence of 2022redis7.0x
[Lao Wang's fallacy of brain science] Why do blind people "seem" to be more "sensitive" than normal people?