当前位置:网站首页>ES6 arrow function
ES6 arrow function
2022-06-30 06:04:00 【SignalFire】
1、this Point to the default object at the time of the call
In the arrow function this Point to the object where it was defined
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<button id="btn">button</button>
</body>
<script>
let btn = document.querySelector("#btn");
btn.addEventListener('click',function(){
setTimeout(() => {
console.log(this);
},1000);
})
</script>
</html>
2、 Arrow functions cannot be used as constructors
3、 Can't use arguments object , Can only be resolved using extended operators
let fn = (...args) => {
console.log(args);
}
fn(1,2,3,4,5);
边栏推荐
- Mysql database learning notes - foreign keys, table connections, subqueries, and indexes for MySQL multi table queries
- Xctf attack and defense world crypto advanced area
- 谁不想要一个自己的博客网站呢 - 搭建博客网站wordpress
- Cisco VXLAN配置
- 网络基础知识
- 583. 两个字符串的删除操作-动态规划
- What do you think of the deleted chat records? How to restore the deleted chat records on wechat?
- 1380. lucky numbers in matrices
- Variable parameters of go
- [regular expression series] greedy and non greedy patterns
猜你喜欢

Base64详解:玩转图片Base64编码
![[ansible series] fundamentals -01](/img/b4/1f3284338c75acb5259849a45bbfbe.jpg)
[ansible series] fundamentals -01

Codeforces C. Andrew and Stones

Configure the user to log in to the device through telnet -- AAA local authentication

PC viewing WiFi password

Projet Web de déploiement du serveur Cloud

Balanced binary tree judgment of Li Kou 110 -- classic problems

Switch to software testing and report to the training class for 3 months. It's a high paying job. Is it reliable?

MySQL数据库用户管理

MySQL advanced (Advanced SQL statement)
随机推荐
Acwing winter vacation daily question 2022 punch in day 11
Do you know how to show the health code in only 2 steps
[regular expression series] greedy and non greedy patterns
SparseArray
Mysql database learning notes - foreign keys, table connections, subqueries, and indexes for MySQL multi table queries
STM32F103 series controlled OLED IIC 4-pin
MySQL transaction
[openstack]-01- basic introduction
Feisheng: Based on the Chinese word breaker ik-2 ways to build custom hot word separators Showcase & pit arrangement Showtime
How to use unmarshaljson
One sentence introduction to Trojan horse
动态规划--怪盗基德的滑翔翼
【学习强化学习】总目录
电脑查看WiFi使用密码
Force deduction exercise -- deleting repeated items in ordered sequence 1.0
1380. lucky numbers in matrices
JS prototype chain object function relationship
超简单 STM32 RTC闹钟 时钟配置
UE4_ Editor UMG close window cannot destroy UMG immediately
[exercise] basic practice letter graph of Blue Bridge Cup