当前位置:网站首页>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);
边栏推荐
- CompletableFuture从了解到精通,你想知道的这里都有
- Create priority queue
- Ultra simple STM32 RTC alarm clock configuration
- Variable parameters of go
- Summation of basic exercise sequence of test questions
- Sword finger offer 29 Print matrix clockwise
- Golang's handwritten Web Framework
- Gestion des utilisateurs de la base de données MySQL
- Dao -- a beautiful new world?
- 动态规划--怪盗基德的滑翔翼
猜你喜欢

One sentence introduction to Trojan horse

1380. lucky numbers in matrices

MySQL transaction

STM32F103 series controlled OLED IIC 4-pin

Cisco vxlan configuration

8 ways to earn passive income
![[secretly kill little partner pytorch20 days] - [day4] - [example of time series data modeling process]](/img/f3/e51cb80f838faba8dfd90596d6e57b.jpg)
[secretly kill little partner pytorch20 days] - [day4] - [example of time series data modeling process]

Mariadb数据库的安装与初始化

Base64详解:玩转图片Base64编码

Here comes the nearest chance to Ali
随机推荐
Detailed explanation of issues related to SSL certificate renewal
反編譯正常回編譯出現問題自己解决辦法
Create priority queue
[OSPF] comparison between rip and OSPF
Develop stylelint rules from zero (plug-ins)
Dao -- a beautiful new world?
Xctf attack and defense world crypto advanced area
InputStream to inputstreamsource
MySQL summary
文件操作IO-Part1
Huxiaochun came to fengshu electronics to sign a strategic cooperation agreement with Zoomlion
Mariadb数据库的安装与初始化
电脑查看WiFi使用密码
Mysql database user management
二十四、输入输出设备模型(串口/键盘/磁盘/打印机/总线/中断控制器/DMA和GPU)
[secretly kill little partner pytorch20 days] - [day4] - [example of time series data modeling process]
Record a problem tracking of excessive load
Beauty of Refactoring: when multithreaded batch processing task lifts the beam - Universal scaffold
UE4_ Editor UMG close window cannot destroy UMG immediately
ES6数组遍历与ES5数组遍历