当前位置:网站首页>The default point of this in JS and how to modify it to 2021.11.09
The default point of this in JS and how to modify it to 2021.11.09
2022-06-28 11:31:00 【Little dream of becoming a big man】
Under each scenario this Default point of :
- Point to... In a normal function window
- Point to... In the event function Event source
- In the timer, point to widnow
- Point to... In the self executing function window
- Point to... In the object object
- There is no... In the arrow function this Point to the Search for superior
modify this The way to point :
1) Function name . call( To change the direction , Parameters 1, Parameters 2,.......);
2) Function name . apply( To change the direction ,【 Parameters 1, Parameters 2,.......】);
3) Function name . bind( To change the direction , Parameters 1, Parameters 2,.......) ;
difference :
call and apply The difference between : The format of parameter transfer is different ,apply In the form of an array .
bind and call/apply The difference between :call/apply Focus on borrowing , There must be a calling procedure , The essence is modification this, and bind Just
It's for modification this, Do not call ( It can be called manually , Back plus () )
bind The meaning of : In some cases , The function does not execute immediately , It's called back at some point Now bind More appropriate , As determined
Timer function .
边栏推荐
- JS foundation 1-js introduction and operator
- Analyze whether there is duplicate data in the list and repeat it several times
- Packaging and publishing application of jetpack compose desktop version
- Get current system date
- 基于验证码识别的机器学习项目captcha_trainer操作实践
- 论文阅读 (59):Keyword-Based Diverse Image Retrieval with Variational Multiple Instance Graph
- This Exception was thrown from a job compiled with Burst, which has limited exception support. 报错
- 关于Pytorch中双向LSTM的输出表示问题
- Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
- day29 js笔记 2021.09.23
猜你喜欢

阿里三面:LEFT JOIN关联表中用ON还是WHERE跟条件有什么区别

Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush

Making and using of static library

Everyone can participate in open source! Here comes the most important developer activity in dragon lizard community

Industry analysis - quick intercom, building intercom

New listing of operation light 3.0 - a sincere work of self subversion across the times!

Scientific research - web of science retrieval skills

day32 js笔记 事件(上)2021.09.27

获取系统当前日期

day29 js笔记 2021.09.23
随机推荐
Create ECS using API shortcut
毕业季 新的开始
Characteristics of solar wireless LED display
赛尔号抽奖模拟求期望
太阳能无线LED显示屏的特点
关于Pytorch中双向LSTM的输出表示问题
SQL中的DQL、DML、DDL和DCL是怎么区分和定义的
day39 原型鏈及頁面烟花效果 2021.10.13
JS基础4
Recommended practice sharing of Zhilian recruitment based on Nebula graph
使用ssm项目对Mysql8进行访问的时候,出现连接失败和一些错误的解决办法
JS基础8
day23 js笔记 2021.09.14
mysql-.sql文件钓鱼上线
工作组环境下的内网渗透:一些基础打法
day32 js笔记 事件(上)2021.09.27
Thesis reading (59):keyword based diverse image retrieval with variable multiple instance graph
获取系统当前日期
2022 开源软件安全状况报告:超41%的企业对开源安全没有足够的信心
Day23 JS notes 2021.09.14