当前位置:网站首页>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 索引
![09- [istio] istio service entry](/img/48/86f8ec916201eefc6ca09c45a60a6a.jpg)
09- [istio] istio service entry

Intelligent question - horse racing question

UE4_ Editor UMG close window cannot destroy UMG immediately

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

MySQL高级SQL语句

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

Lantern Festival | maoqiu technology and everyone "guess riddles and have a good night"

Shenzhou ares tx6 boot logo modification tutorial

Summation of basic exercise sequence of test questions
随机推荐
动态规划--怪盗基德的滑翔翼
网络基础知识
接口中方法详解
VLAN access mode
MySQL index
ES6解构赋值
I have been working as a software testing engineer for 5 years, but I was replaced by an intern. How can I improve myself?
Dao -- a beautiful new world?
谁不想要一个自己的博客网站呢 - 搭建博客网站wordpress
Base64详解:玩转图片Base64编码
MySQL 索引
Golang之手写web框架
How to use unmarshaljson
[MD editing required] welcome to the CSDN markdown editor
Ultra simple STM32 RTC alarm clock configuration
Vscode configuration proxy
How does WPS cancel automatic numbering? Four options
inno setup 最简单的自定义界面效果
观察者模式、状态模式在实际工作中的使用
ES6箭头函数