当前位置:网站首页>The difference between arrow function and arrow function
The difference between arrow function and arrow function
2022-07-18 02:40:00 【Laugh when you are cheap ~】
1. Arrow functions are not bound arguments, Replace it with rest Parameters (…a) => {console.log(a)} solve
2. Arrow function cannot be used as Generator function , Out of commission yield keyword
3. Arrow functions have no prototype properties :
(()=>{ }).prototype // undefined
(function a(){}).prototype // {constructor: ƒ}
ES6 The syntax of arrow function is added in , Arrow functions are simple and easy to obtain this Characteristics of :
Under ordinary function this:
+ In ordinary functions this Always represents its direct caller , By default ,this refer to window,
+ In strict mode , There is no direct caller in the function of this yes undefined Use
+ call,apply,bind(ES5 newly added ) The binding of ,this refer to Bound object
In the arrow function this:
+ Arrow function does not have its own this, its this It's inherited ; By default, it points to the object where it was defined ( Host object ),
+ Not the object at execution time , When you define it , Maybe the environment is window, It could be something else .
边栏推荐
- How does the mobile phone control the LED display to send video?
- Vector
- 2022-04-20 unity introduction 7 - collision detection of physical systems
- 2022-04-20 Unity入门9——其他
- Use iceberg in CDP to pressurize the data Lake warehouse
- 2022-04-21 unity entry 8 - sound system
- Redis uses pipeline
- 2022 global developer salary PK: China ranks 19th, and using go language is the most profitable
- IDEA Smart Checkout和Force Checkout区别
- Binary search (bottom)
猜你喜欢

CCF 202012-1 期末预测之安全指数

想要白嫖正则是吧?这一次给你个够!

MySQL batch add test data
![[design topics] project summary of graduation design topics based on C51 single chip microcomputer - 500 cases](/img/be/86532861c1485243825ca3182b39a7.png)
[design topics] project summary of graduation design topics based on C51 single chip microcomputer - 500 cases

Redis使用管道PipeLine

Kotlin 插件的落幕,ViewBinding 的崛起

2022-04-18 Unity入门1——窗口布局

2022-04-20 Unity入门6——光源组件

Basic concepts

PowerDesigner安装教程
随机推荐
元素dependencies和dependencyManagement的区别
Bc20 at command test
Solve the problem of installing Oracle /usr/bin/ld: cannot find -lclntshcore
2022-04-21 unity foundation 2 - important content of monobehavior
手机怎样控制led显示屏发视频?
03 按键控制LED
想要白嫖正则是吧?这一次给你个够!
Figure 1: four directions and three strategies for digital transformation of state-owned enterprises
Dragon lizard community recruitment Promotion Ambassador & experience officer| Everyone can participate in open source
Custom paging and labeling encapsulation
相關小知識點
Ignore, on duplicate key update, delayed in MySQL
Follow up by Dutch depositors
Meta宣布推出Make-A-Scene:可基于文字和草图控制AI图像生成
What are the main functions of Yunna dynamic ring monitoring system
基础概念
基于eTS高效开发HarmonyOS课程类应用
Is there a future for the Internet?
pygame快速入门
Summer learning plan [activities]